Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
python-libmount
util-linux-loop-reuse-fix-1.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-loop-reuse-fix-1.patch of Package python-libmount
From 3789806db21dea8e009ceea8f6158bc778151afe Mon Sep 17 00:00:00 2001 From: Stanislav Brabec <sbrabec@suse.cz> Date: Thu, 12 Jan 2017 15:45:27 +0100 Subject: [PATCH] libmount: fix mount -oloop=/dev/loopX regression If mount option "loop" is used with an argument, it should be respected. Commit 8efad715 introduced a regression. Even with an argument, overlaying loop device is searched and argument is ignored. It could have unexpected side effects. If argument is set, never allocate a new loop device. How to reproduce: mkdir -p cdrom mkisofs -o cdrom.iso cdrom/ 2>/dev/null losetup /dev/loop0 cdrom.iso strace mount -t auto -o ro,loop=/dev/loop1 cdrom.iso /mnt 2>&1 | grep ^mount cat /proc/self/mountinfo | grep /mnt umount /mnt losetup -d /dev/loop0 mount("/dev/loop0", "/mnt", "iso9660", MS_MGC_VAL|MS_RDONLY, NULL) = 0 327 60 7:0 / /mnt ro,relatime shared:241 - iso9660 /dev/loop0 ro losetup: /dev/loop0: detach failed: No such device or address Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> --- libmount/src/context_loopdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libmount/src/context_loopdev.c b/libmount/src/context_loopdev.c index 8ef183107..18eb2cc56 100644 --- a/libmount/src/context_loopdev.c +++ b/libmount/src/context_loopdev.c @@ -259,7 +259,12 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt) goto done; } rc = 0; - goto success; + /* loop= used with argument. Conflict will occur. */ + if (loopval) { + rc = -MNT_ERR_LOOPOVERLAP; + goto done; + } else + goto success; } default: /* error */ goto done; -- 2.13.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor