]> git.ipfire.org Git - thirdparty/util-linux.git/commit
losetup: Prevent AUTOCLEAR detach race
authorStanislav Brabec <sbrabec@suse.cz>
Wed, 17 Aug 2016 10:54:40 +0000 (12:54 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Aug 2016 10:58:12 +0000 (12:58 +0200)
commitf27d989c67eb0d85b3bfc54807e626ff16e71f56
tree3650f08eebe0e4caad26045bcd1c2d8627ee1b60
parentbfd4e1f75898510f93779766688cc5086404c23b
losetup: Prevent AUTOCLEAR detach race

Kernel needs some time to delete a device after losetup --detach. If
the losetup --find --nooverlay is called just after losetup --delete,
it can sometimes attempt to recycle the device that is just being
released.  To prevent this race, clear the AUTOCLEAR flag of the
device.

[kzak@redhat.com: - rebase to the new version of the code]

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