]> git.ipfire.org Git - thirdparty/util-linux.git/commit
losetup: add --nooverlap options
authorKarel Zak <kzak@redhat.com>
Wed, 17 Aug 2016 10:28:33 +0000 (12:28 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Aug 2016 10:28:33 +0000 (12:28 +0200)
commit9a94b634a343e83bfa2a9d311074e3e520abdddd
treeb1118ead3294be824b9fdbbf01449bb822aad4cf
parentf066f32aaec26e96f88e8043692fdb3214dfd14f
losetup: add --nooverlap options

This patch introduces overlap detections and loop devices
re-use for losetup(8). We already support this feature for mount(8)
where it's enabled by default (because we mount filesystems and it's
always mistake to share the same filesystem between more loop
devices).

Stanislav has suggested to enable this feature also for losetup by
default. I'm not sure about it, IMHO it's better to keep losetup(8)
simple and stupid by default, and inform users about possible problems
and solutions in the man page.

The feature forces losetup to scan all loop devices always when new
one is requested. This maybe disadvantage (especially when we use
control-loop  to avoid /sys or /dev scans) on system with huge number
of loop devices.

Co-Author: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c
sys-utils/losetup.8
sys-utils/losetup.c