Re: [PATCH] tests: add test for loop option in fstab (my mistake, and two new bugs, one in kernel)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 24, 2016 at 19:58 Stanislav Brabec wrote:
> # mount -osubvol=/ /dev/loop1 /mnt/1
> mount: /dev/loop1 is already mounted or /mnt/1 busy
>         /dev/loop1 is already mounted on /mnt/1

OOPS, sorry, my mistake. I forgot loop mounted on /mnt/1 that confused
me.

But I already found a real explanation of the umount error in the test
case failure: There is a kernel bug!

# mount -oloop tests/output/mount/fstab-btrfs.img /mnt
# mount -oloop,subvol=/ tests/output/mount/fstab-btrfs.img /mnt2

Both succeeded and returned code 0.

Two mounts should be created, but only one is:

# mount | grep mnt
/dev/loop1 on /mnt type btrfs (rw,relatime,space_cache,subvolid=257,subvol=/d0/dd0/ddd0/s1/d1/dd1/ddd1/s2)

Yes, /mnt2 was ignored.

Once I
umount /mnt
it succeeds:
# mount | grep mnt
/home/sbrabec/util-linux/tests/output/mount/fstab-btrfs.img on /mnt2 type btrfs (rw,relatime,space_cache,subvolid=5,subvol=/)

Surprisingly, the format of the mount line is different.

And even more surprisingly, strace shows:

mount("/dev/loop1", "/mnt2", "btrfs", MS_MGC_VAL, "subvol=/") = 0
access("/mnt2", W_OK)                   = 0

=> It looks like a kernel bug.
Kernel is openSUSE Tumbleweed linux-4.4.1-1.


Looking deeper, the different format of lines seems to be util-linux
fault, because /proc/self/mountinfo lines are in an equal format:

222 59 0:71 /d0/dd0/ddd0/s1/d1/dd1/ddd1/s2 /mnt rw,relatime shared:150 - btrfs /dev/loop0 rw,space_cache,subvolid=257,subvol=/d0/dd0/ddd0/s1/d1/dd1/ddd1/s2

222 59 0:71 / /mnt2 rw,relatime shared:150 - btrfs /dev/loop0 rw,space_cache,subvolid=5,subvol=/

=> This one looks like an util-linux bug.


It seems, that also the code evaluating loop mounts needs btrfs default
subvolume check. Because it starts to work, if I specify subvol or
subvolid of the default mount explicitly.

# mount -oloop,subvol=/d0/dd0/ddd0/s1/d1/dd1/ddd1/s2 tests/output/mount/fstab-btrfs.img /mnt
/home/sbrabec/util-linux/tests/output/mount/fstab-btrfs.img on /mnt type btrfs (rw,relatime,space_cache,subvolid=257,subvol=/d0/dd0/ddd0/s1/d1/dd1/ddd1/s2)
# mount -oloop,subvolid=257 tests/output/mount/fstab-btrfs.img /mnt
# mount | grep mnt
/home/sbrabec/util-linux/tests/output/mount/fstab-btrfs.img on /mnt type btrfs (rw,relatime,space_cache,subvolid=257,subvol=/d0/dd0/ddd0/s1/d1/dd1/ddd1/s2)

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@xxxxxxxx
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                 fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux