Re: [PATCH 5/8] Prevent AUTOCLEAR detach race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karel Zak wrote:
On Tue, Aug 02, 2016 at 07:58:29PM +0200, Stanislav Brabec wrote:
+				lc.info.lo_flags &= !LO_FLAGS_AUTOCLEAR;

This is strange, what if the device we want to reuse has been created
by mount(8) and AUTOCLEAR flag is wanted.

I think that once we use losetup, we do not want AUTOCLEAR, but we change to explicit losetup -d.

Without this patch, the testsuite test losetup-loop/find-race-condition will fail, because "losetup -d /dev/loop0" actually does not free the device immediately, but only sets AUTOCLEAR flag. The device still exists for a fraction of second, and consequent losetup is able to find it and return it. But the device continues in release process and disappear before it is used.

To discriminate between AUTOCLEAR device used by mount and AUTOCLEAR device just dying, that will disappear soon, we would check for use count.

--
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@xxxxxxxx
Křižíkova 148/34 (Corso IIa)                  tel: +49 911 7405384547
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux