Bug 725867

Summary: Can't remount loopback mount read-only
Product: [Fedora] Fedora Reporter: Daniel Drake <dsd>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: aquini, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-25 07:40:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Daniel Drake 2011-07-26 19:27:47 UTC
In Fedora 14, the test case below worked fine. In Fedora 15, it fails. I think this is due to the change to have /etc/mtab as a symlink to /proc/mounts.

# dd if=/dev/zero of=fs.img bs=1M count=20
# mkfs.ext4 fs.img
# mkdir mountpt
# mount -o loop fs.img mountpt

Now try to remount it read-only:

# mount -o remount,ro mountpt
mount: /home/dsd/tmpdisk/mountpt not mounted already, or bad option

(On Fedora 14 no error was returned and the mount became read-only)

When the error occurs, dmesg says:
[ 5495.860391] EXT4-fs (loop0): Unrecognized mount option "seclabel" or missing value

Here is the corresponding entry from /proc/mounts:
/dev/loop0 /home/dsd/tmpdisk/mountpt ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0

Digging further, it looks like this was fixed upstream (via bug #676630). Locally, I have added these 2 commits to 2.6.38.8-36.fc15:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ff36fe2c845cab2102e4826c1ffa0a6ebf487c65
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=026eb167ae77244458fa4b4b9fc171209c079ba7

The resultant scratch-build is here: http://koji.fedoraproject.org/koji/taskinfo?taskID=3231906

I am now running this kernel and can confirm that those 2 commits solve the issue. Please could they be added to the next F15 kernel?

This issue is hit by olpc-os-builder which tries to remount a loopback mount. It would be great to have it fixed. Thanks!

Comment 1 Daniel Drake 2011-08-25 07:40:17 UTC
Now fixed with the 2.6.40 kernel. Thanks!