[Bug 809737] New: mount -oloop,sizelimit=nnnnnn ignores the sizelimit
https://bugzilla.novell.com/show_bug.cgi?id=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c0 Summary: mount -oloop,sizelimit=nnnnnn ignores the sizelimit Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: puzel@suse.com ReportedBy: jeffm@suse.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- I recently tried to mount an hfsplus file system from an image file with a partition table by using the loop offset and sizelimit options to specify the location of the file system. hfsplus stores some metadata at a set offset from the end of the partition, so it's sensitive to the device size reported by the kernel. It worked with this: # losetup -r -o 32k --sizelimit=102400000 <loopdev> <imagefile> # mount -r -t hfsplus <loopdev> <mountpoint> But failed with this: # mount -r -oloop,offset=32k,sizelimit=102400000 <imagefile> <mountpoint> # losetup -a /dev/loop0: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /dev/loop1: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /proc/partitions shows the correct number of blocks to match the sizelimit. But if I set a breakpoint in mount before the mount syscall, I could see: # blockdev --getsize64 /dev/loop[01] 102400000 102432768 Patch to follow. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c1 --- Comment #1 from Jeff Mahoney <jeffm@suse.com> 2013-03-15 16:59:21 EDT --- Created an attachment (id=530023) --> (http://bugzilla.novell.com/attachment.cgi?id=530023) [PATCH] loopdev: sync capacity after setting it The kernel loop driver will set the gendisk capacity of the device at LOOP_SET_STATUS64 but won't sync it to the block device until one of two conditions are met: All open file descriptors referring to the device are closed (and it will sync when re-opened) or if the LOOP_SET_CAPACITY ioctl is called to sync it. Since mount opens the device and passes it directly to the mount syscall after LOOP_SET_STATUS64 without closing and reopening it, the sizelimit argument is effectively ignroed. The capacity needs to be synced immediately for it to work as expected. This patch adds the LOOP_SET_CAPACITY call to loopctx_setup_device since the device isn't yet released to the user, so it's safe to sync the capacity immediately. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c2 --- Comment #2 from Jeff Mahoney <jeffm@suse.com> 2013-03-15 17:18:09 EDT --- SR 159629 -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c3 --- Comment #3 from Jeff Mahoney <jeffm@suse.com> 2013-03-15 17:33:37 EDT --- Incidentally, this has been fixed in the kernel in 3.9-rc1. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c4 --- Comment #4 from Jeff Mahoney <jeffm@suse.com> 2013-03-15 17:45:13 EDT --- ... and makes triggering a deadlock in the loop code a lot easier in previous kernels. Hold off on accepting this one until I can commit the kernel fixes first. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c5 --- Comment #5 from Jeff Mahoney <jeffm@suse.com> 2013-03-17 10:24:53 EDT --- This patch assumes the ioctl will be there but it was introduced in 2.6.30. I'll attach the new patch once I update it on the ML. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c6 --- Comment #6 from Jeff Mahoney <jeffm@suse.com> 2013-03-19 10:09:42 EDT --- The kernel patches have been queued for -stable upstream. We should get them soon in our kernels. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c Petr Uzel <puzel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Status|NEW |ASSIGNED -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c7 Petr Uzel <puzel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |jeffm@suse.com --- Comment #7 from Petr Uzel <puzel@suse.com> 2013-03-25 15:22:44 UTC --- (In reply to comment #6)
The kernel patches have been queued for -stable upstream. We should get them soon in our kernels.
So, do we really need this to be fixed in our util-linux package? -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c8 Jeff Mahoney <jeffm@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|jeffm@suse.com | --- Comment #8 from Jeff Mahoney <jeffm@suse.com> 2013-03-25 11:25:14 EDT --- For older releases, yes. The kernel patches don't eliminate the original issue. They only eliminate the deadlock that will occur with the fix applied. We don't need the patch for 12.4, but we'll probably get it anyway when util-linux is updated. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c9 Petr Uzel <puzel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |jeffm@suse.com --- Comment #9 from Petr Uzel <puzel@suse.com> 2013-03-27 14:37:20 UTC --- OK, thanks. One more question: do you still plan to post updated patch to the util-linux mailing list? -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c10 Jeff Mahoney <jeffm@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|jeffm@suse.com | --- Comment #10 from Jeff Mahoney <jeffm@suse.com> 2013-03-27 16:46:55 EDT --- Created an attachment (id=532240) --> (http://bugzilla.novell.com/attachment.cgi?id=532240) [PATCH v2] loopdev: sync capacity after setting it Yes, I posted this to the util-linux mailing list a few minutes ago. -- 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=809737 https://bugzilla.novell.com/show_bug.cgi?id=809737#c12 --- Comment #12 from Stanislav Brabec <sbrabec@suse.com> 2013-11-05 17:26:56 CET --- Looking at util-linux-2.23.2, oopcxt_set_capacity() seems to do the same as your patch. So it seems to be fixed for 13.1. Is there any request to fix it for 12.3 and/or SLE11/SLE10? -- 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