[Btrfs-devel] subvol=. bug

Pär Andersson paran at lysator.liu.se
Mon Feb 18 16:24:06 PST 2008


Hi,

First I will mention that I am still running btrfs on / without any
big problems. :-)

However I have found another bug. If I have at least one snapshot
other than default, and mount using "-o subvol=." then readdir on that
directory keeps returning the same entry over and over. This is with latest 
btrfs-unstable, linux 2.6.24.2 on i686.

1. Create a new btrfs:

root at garbage:~# mkfs.btrfs /dev/loop0
fs created on /dev/loop0 nodesize 16384 leafsize 16384 sectorsize 4096 bytes 
1048576000

2. Mount and create a snapshot:

root at garbage:~# mount /dev/loop0 /mnt/tmp/
root at garbage:~# btrfsctl -s snap /mnt/tmp
ioctl returns 0
root at garbage:~# umount /mnt/tmp 

3. Mount with subvol=. and try to list the subvolumes:

root at garbage:~# mount -o subvol=. /dev/loop0 /mnt/tmp/
root at garbage:~# ls /mnt/tmp/
ls: memory exhausted
root at garbage:~# ltrace -o /tmp/ltrace ls /mnt/tmp/

Interesting part of the ltrace:
...
opendir("/mnt/tmp/")                                                 = 
0x8068350
readdir64(0x8068350)                                                 = 
0x806836c
readdir64(0x8068350)                                                 = 
0x8068384
readdir64(0x8068350)                                                 = 
0x806839c
strlen("default")                                                    = 7
malloc(8)                                                            = 
0x8068318
memcpy(0x8068318, "default", 8)                                      = 
0x8068318
readdir64(0x8068350)                                                 = 
0x80683bc
strlen("snap")                                                       = 4
malloc(5)                                                            = 
0x8069370
memcpy(0x8069370, "snap", 5)                                         = 
0x8069370
readdir64(0x8068350)                                                 = 
0x806836c
strlen("snap")                                                       = 4
malloc(5)                                                            = 
0x8069380
memcpy(0x8069380, "snap", 5)                                         = 
0x8069380
readdir64(0x8068350)                                                 = 
0x806836c
strlen("snap")                                                       = 4
malloc(5)                                                            = 
0x8069390
memcpy(0x8069390, "snap", 5)                                         = 
0x8069390
readdir64(0x8068350)                                                 = 
0x806836c
strlen("snap")                                                       = 4
malloc(5)                                                            = 
0x80693a0
... and so on ...


Regards,

Pär Andersson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://oss.oracle.com/pipermail/btrfs-devel/attachments/20080219/bc98ebeb/attachment.bin


More information about the Btrfs-devel mailing list