Bug 9975

Summary: umount failing to unmount by label when label includes a "-"
Product: Mageia Reporter: George Mitchell <george>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Normal CC: mageia, tmb
Version: 3Keywords: Triaged
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: util-linux-2.22.2-5.mga3.src.rpm CVE:
Status comment:

Description George Mitchell 2013-05-04 07:26:55 CEST
Description of problem:

On my Mageia 3 32bit OS I routinely mount and unmount filesystem with labels including a "-".  But now I am finding I cannot do that with the 64 bit system for some reason.

Version-Release number of selected component (if applicable):


How reproducible:

[root@localhost BACKUP]# mount LABEL=MAGEIA3BTR /backup/mageia3btr/multiboot
[root@localhost BACKUP]# umount LABEL=MAGEIA3BTR
[root@localhost BACKUP]# mount LABEL=MAGEIA3BTR-BOOT /backup/mageia3btr/boot/multiboot
[root@localhost BACKUP]# umount LABEL=MAGEIA3BTR-BOOT
umount: LABEL=MAGEIA3BTR-BOOT: not found


Steps to Reproduce:
1.
2.
3.


Reproducible: 

Steps to Reproduce:
Comment 1 George Mitchell 2013-05-04 17:05:15 CEST
I verified that umount is working on labels with dashes in the 32 bit Mageia 3 system.  The OTHER difference is that in the case of the 32 bit system the umount request involves unmounting a single ext4 partition.  In the case of the 64 bit Mageia 3 system that fails, the unmount request involves two btrfs partitions operating in RAID 1 mode.  I suspect that umount is having a problem with a label name with a dash ONLY in the case of btrfs multipartition mounts.  This suggests some sort of coding error within the umount binary itself, since I doubt that the 32 bit version source code differs from the 64 bit version source code.
Comment 2 George Mitchell 2013-05-05 05:23:52 CEST
As a workaround I am using the following until this gets fixed:


[root@localhost mnt]# umount `mount -l | egrep "\[MAGEIA3BTR-BOOT\]" | cut -d" " -f1`
Manuel Hiebel 2013-05-05 12:12:12 CEST

Keywords: (none) => Triaged
CC: (none) => mageia, tmb

Comment 3 Colin Guthrie 2013-05-06 12:24:04 CEST
Looks like a general util-linux issue I guess, but one we likely won't get a chance to look at until later. If at all possible co uld you come up with a bunch of commands to set things up in a way that demonstrates this (e.g. 1. assume two partitions /dev/sdb1 and /dev/sdb2 of type X; 2 mkbrtfs ... etc. etc.)?

That way we can test this much more easily (perhaps in a VM etc).
Comment 4 George Mitchell 2013-05-06 16:59:42 CEST
Thanks Colin, I understand you have a full plate right now and am in no hurry as I have a fully functional workaround for this one.  I will try to go through all the util-linux suite and test for other possibly related failures and post them against this bug report.  - George
Comment 5 Colin Guthrie 2013-05-06 17:03:13 CEST
If you're on IRC then the upstream util-linux maintainer is really approachable. Karel Zak or kzak on Freenode or https://plus.google.com/111319147897550904359/posts

He's always been helpful to me in the past.
Comment 6 George Mitchell 2013-05-06 18:13:18 CEST
Thanks.  At this point it looks like only umount and findmnt are affected.  Most util-linux commands are not fs related or do not support labels.  Of the ones that are blkid, findfs and wipefs look OK.  And fsck and mkfs are only frontends for external commands and thus are not affected.  - George
Comment 7 Colin Guthrie 2013-05-06 18:37:07 CEST
I know that umount and findmnt got a bit or rework recently upstream, so you never know it may be fixed by now anyway:

http://karelzak.blogspot.co.uk/2013/04/umount8-mount8-and-nsenter1.html
Comment 8 George Mitchell 2013-05-06 23:52:16 CEST
At this point I am subscribed to the util-linux list, so I will simply present the problem there and most likely someone on that list will be on top of the issue.  I will close this bug report as soon as a fix comes down.  Thanks,  George
Comment 9 George Mitchell 2013-05-07 18:04:17 CEST
I think I see what is going on here thanks to some help from Karel.  It appears that mount works fine because it simply grabs whatever /dev/sd.. it finds and mounts it and all works well.  But with umount, it grabs a /dev/sd.. and then goes to check the mount table and ... the /dev/sd.. on the mount table is a DIFFERENT device (part of the multipartition btrfs volume) and so umount responds that it can't find the LABEL.  It couldn't find the label because it couldn't find the device it was looking for which was part of the right volume but was NOT the mount point.  IF it HAPPENS by luck to select the right /dev/sd.. on the first pass the umount WILL succeed.  In the case of findmnt, the same logic is at work.  Karel tried to test this out and couldn't find the bug, but he was not using multipartition volumes.  I expect this to get VERY interesting when we stop using partitions altogether, which I am alreading doing with one 4TB volume.  Not partitioning simplifies the whole process especially in the case of huge hard drive sizes and it also makes "virtual partitioning" via subvolumes very attractive since they can be done dynamically on a running system and you can't do that safely with conventional partitioning.  - George
Comment 10 George Mitchell 2013-05-09 16:15:50 CEST
Colin,  What Karel seems to be telling me at this point is that this is NOT a bug and that he is basically NOT going to support umount by LABEL on multipartition btrfs volumes because technically only one of the partitions is mounted so there is really no way to umount the whole volume, or something such.  In other words, he considers it an enhancement request rather than a bug.  I find this mindset really exasperating because, while umount and findmnt are easily kluged around, other things are sitting out there that will likely face the same fate and will not be so easily kluged around.  And the effect will be to degrade the value of btrfs.  But I suppose that as much as I love the world of GPL software, there are some downsides that one just has to accept.  So, I am simply going to close this bug as resolved at this point because, if upstream won't deal with it, I don't think you should have to.  - George
Comment 11 George Mitchell 2013-05-09 16:17:54 CEST
Closing this bug as invalid per response from Karel Zak upstream util-linux maintainer.

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Comment 12 Colin Guthrie 2013-05-09 16:44:32 CEST
FWIW, I think his interpretation is reasonable. It's a case that is kinda tricky to deal with generally (the whole argument could probably also apply to bind mounts within the same fs too).

Regardless of whether it's a bug or an enhancement, he's acknowledged that it's something that would need fixing even if the semantics are such that it's not *technically* a bug but an enhancement. btrfs is changing a lot of things generally and this is the kind of fallout at is expected IMO. No point in getting too worked up about it! :)

Thanks for reporting back tho'. Wish more bug reports were like this :) (although better outcomes would be nice!)