Re: losetup race on -f file

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

 



On Fri, Jun 12, 2015 at 09:44:03AM +0000, Felipe Franciosi wrote:
> Hi All,
> 
> I'm seeing a race when using "losetup -f file". Some research
> pointed me to a 2007 path that introduced a "retry" mechanism if the
> module returned EBUSY. At some point before the project went into
> git.kernel.org this commit went away.

I still see EBUSY sensitivity:

  https://github.com/karelzak/util-linux/blob/master/sys-utils/losetup.c#L684

the problem is probably loopcxt_setup_device() where we does not save
errno and does not set proper return value.

I'll try to fix it. Thanks for you report!

> Can anyone clarify? I'm currently flock()ing /var/lock/losetup outside calls to losetup.
> Objections to a losetup patch to do that internally?

Do you mean flock() within losetup? I'd like to avoid such thing.

    Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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