|
Bugzilla – Full Text Bug Listing |
| Summary: | System writes to a loop mount of a RO image. | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.2 | Reporter: | Carlos Robinson <carlos.e.r> |
| Component: | Kernel | Assignee: | E-mail List <kernel-maintainers> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Major | ||
| Priority: | P5 - None | CC: | jeffm |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE 11.2 | ||
| Whiteboard: | maint:released:11.2:36688 | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Carlos Robinson
2010-10-18 10:04:40 UTC
Ok, this is a simple issue of the fix for bug #441062, also reported by you, not making it into 11.2. 11.1 doesn't have this issue because it's based on the SLE11 kernel, which has the fix. 11.3 doesn't have this issue because the fix was accepted upstream for 2.6.34. I've added the fix to 11.2. Thanks for drawing my attention back to it. I'm testing this in 11.3, for completeness (2.6.34.7-0.3-desktop). Same test as above, but I will not copy-paste the exact outputs (it is another machine). 1) R/W filesystem, RO image. Loop mounted with default, automatic, options. It writes and modifies the image. 2) R/W filesystem, RO image. Loop mounted with "-o ro". Writes to filesystem fails. However, the md5sum changes... something was written. 2b) Same, but no attempt to write a file, ie: calculate md5sum, mount R/O, umount, md5sum again: it has changed. 3) RO filesystem Image is automatically mounted R/O, and writes to it fails. Image file is not modified. Point 1 and 2 prove that the bug is present in 11.3 too. Sorry. In case "1" Mount should also automatically mount as RO as in case "3", as the image has no write permissions. Permissions are ignored. But even if it is mounted RO, at least the journal is altered. This has been tested with a reiserfs image - I don't know if other filesystems are affected. I can try that as well, if requested. Update released for: kernel-debug, kernel-debug-base, kernel-debug-base-debuginfo, kernel-debug-debuginfo, kernel-debug-debugsource, kernel-debug-devel, kernel-debug-devel-debuginfo, kernel-default, kernel-default-base, kernel-default-base-debuginfo, kernel-default-debuginfo, kernel-default-debugsource, kernel-default-devel, kernel-default-devel-debuginfo, kernel-desktop, kernel-desktop-base, kernel-desktop-base-debuginfo, kernel-desktop-debuginfo, kernel-desktop-debugsource, kernel-desktop-devel, kernel-desktop-devel-debuginfo, kernel-pae, kernel-pae-base, kernel-pae-base-debuginfo, kernel-pae-debuginfo, kernel-pae-debugsource, kernel-pae-devel, kernel-pae-devel-debuginfo, kernel-source, kernel-source-vanilla, kernel-syms, kernel-trace, kernel-trace-base, kernel-trace-base-debuginfo, kernel-trace-debuginfo, kernel-trace-debugsource, kernel-trace-devel, kernel-trace-devel-debuginfo, kernel-vanilla, kernel-vanilla-base, kernel-vanilla-base-debuginfo, kernel-vanilla-debuginfo, kernel-vanilla-debugsource, kernel-vanilla-devel, kernel-vanilla-devel-debuginfo, kernel-xen, kernel-xen-base, kernel-xen-base-debuginfo, kernel-xen-debuginfo, kernel-xen-debugsource, kernel-xen-devel, kernel-xen-devel-debuginfo, preload-kmp-default, preload-kmp-desktop Products: openSUSE 11.2 (debug, i586, x86_64) What you're describing isn't a bug. It's a misunderstanding of what the terms mean. Read-only file system does /not/ mean that the file system metadata will not be touched, just that users including root will not be allowed to modify it. Things like journal replay are allowed. Read-only block device means that absolutely no writers will be allowed. Note that in all your examples above, you were operating as root. When you do an losetup without a -r, it assumes you want a read-write encapsulation. If the caller doesn't have permission to open the file read-write, it will be denied permission to set up the encapsulation. Here's the hitch: When the user is root, then all permissions are granted except when the file is marked immutable (chatter, not chmod) or the underlying file system is read-only. Since permissions are granted, the block device is created read-write. If a regular user, who happens to have permission to open a /dev/loop device, has a read-only file, then the read-write open of the file would be disallowed by the kernel so the loop driver could not be passed a read-write file descriptor. As a result, the underlying block device would be read-only. So, for the behavior you're looking for, set up the loop device with losetup -r /dev/loop* <file> and then mount read-only and you'll get a truly read-only device and file system. If you normally use mount -r -oloop blahblah to set up the mount point, then you might have a case for mount not having a method to set up the block device read-only. If you want to pursue that, please file a new report against the Basesystem component. I misunderstood the original description of the bug to mean that it was a duplicate of the original reiserfs issue where it would attempt to write to a read-only block device and fail -- or it would fail when there was no reason for it to fail. In that case, I'm going to close this one as FIXED. |