[Bug 880858] New: bcache symbolic links in /dev/bcache/by-uuid are unstable

https://bugzilla.novell.com/show_bug.cgi?id=880858 https://bugzilla.novell.com/show_bug.cgi?id=880858#c0 Summary: bcache symbolic links in /dev/bcache/by-uuid are unstable Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: x86-64 OS/Version: openSUSE 13.1 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: seroton10@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 Using a standard and fully updated openSUSE 13.1 running in a KVM, I demonstrate that the symbolic links to bcache devices under in /dev/bcache/by-uuid are unstable. Exactly the same bug when running outside of a VM. Reproducible: Always Steps to Reproduce: 1. A zeroed-out block device /dev/vdb is added to the KVM, and some partitions are created for testing: Disk /dev/vdb: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x4df97356 Device Boot Start End Blocks Id System /dev/vdb1 2048 1026047 512000 83 Linux /dev/vdb2 1026048 1230847 102400 83 Linux 2. bcache backing and cache devices are set up: vbase:~ # make-bcache -B /dev/vdb1 -C /dev/vdb2 UUID: db49ed8a-522a-4823-9ac6-24964450e556 Set UUID: 40c17628-f9d9-4ebf-9eea-b1196e5f206c version: 0 nbuckets: 500 block_size: 1 bucket_size: 1024 nr_in_set: 1 nr_this_dev: 0 first_bucket: 1 UUID: 9c38f1ae-d2d4-47e3-8764-304624aae65f Set UUID: 40c17628-f9d9-4ebf-9eea-b1196e5f206c version: 1 block_size: 1 data_offset: 16 vbase:~ # ls -l /dev/bcache/by-uuid/ total 0 lrwxrwxrwx 1 root root 13 May 31 23:12 9c38f1ae-d2d4-47e3-8764-304624aae65f -> ../../bcache0 vbase:~ # lsblk /dev/vdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vdb 253:16 0 1G 0 disk ├─vdb1 253:17 0 500M 0 part │ └─bcache0 251:0 0 500M 0 disk └─vdb2 253:18 0 250M 0 part └─bcache0 251:0 0 500M 0 disk 3. A file system is initialized on the cached device: vbase:~ # mkfs.ext4 /dev/bcache0 mke2fs 1.42.8 (20-Jun-2013) Discarding device blocks: done Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 128016 inodes, 511992 blocks 25599 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67633152 63 block groups 8192 blocks per group, 8192 fragments per group 2032 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 Allocating group tables: done Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done vbase:~ # ls -l /dev/bcache/by-uuid/ ls: cannot access /dev/bcache/by-uuid/: No such file or directory 4. After a reboot we have: vbase:~ # lsblk /dev/vdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vdb 253:16 0 1G 0 disk ├─vdb1 253:17 0 500M 0 part │ └─bcache0 251:0 0 500M 0 disk └─vdb2 253:18 0 250M 0 part └─bcache0 251:0 0 500M 0 disk vbase:~ # ls -l /dev/bcache/by-uuid/ total 0 lrwxrwxrwx 1 root root 13 May 31 23:18 9c38f1ae-d2d4-47e3-8764-304624aae65f -> ../../bcache0 5. Define a mount point for the cached device based on the symlink: vbase:~ # echo "/dev/bcache/by-uuid/9c38f1ae-d2d4-47e3-8764-304624aae65f /mnt ext4 defaults 1 2" >>/etc/fstab vbase:~ # mount /mnt vbase:~ # lsblk /dev/vdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vdb 253:16 0 1G 0 disk ├─vdb1 253:17 0 500M 0 part │ └─bcache0 251:0 0 500M 0 disk /mnt └─vdb2 253:18 0 250M 0 part └─bcache0 251:0 0 500M 0 disk /mnt vbase:~ # ls -l /dev/bcache/by-uuid/ total 0 lrwxrwxrwx 1 root root 13 May 31 23:18 9c38f1ae-d2d4-47e3-8764-304624aae65f -> ../../bcache0 6. After a reboot we find the cached device mounted, but no symlink: vbase:~ # lsblk /dev/vdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vdb 253:16 0 1G 0 disk ├─vdb1 253:17 0 500M 0 part │ └─bcache0 251:0 0 500M 0 disk /mnt └─vdb2 253:18 0 250M 0 part └─bcache0 251:0 0 500M 0 disk /mnt vbase:~ # ls -l /dev/bcache/by-uuid/ ls: cannot access /dev/bcache/by-uuid/: No such file or directory Actual Results: In step 3, the directory with the symbolic links to the cache device disappears after initializing a file system on it. After a reboot in step 4 it comes back. In step 5, mounting the cached device via an fstab entry based on the symbolic link works, and the symbolic link remains, as expected. However, after a reboot in step 6, even though the mount point works, the symbolic link is no longer present. Expected Results: Once /dev/bcache0 has been created (in step 2), the /dev/bcache/by-uuid/ directory should always provide a symbolic link to it in all use cases above. This bug becomes a real problem if more than one bcache device is in use, because the symlinks in /dev/bcache/by-uuid/ can't be relied upon. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.

https://bugzilla.novell.com/show_bug.cgi?id=880858 https://bugzilla.novell.com/show_bug.cgi?id=880858#c zhang jiajun <jzhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jzhang@suse.com AssignedTo|bnc-team-screening@forge.pr |jengelh@inai.de |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com