Karel Zak <[EMAIL PROTECTED]> writes:

> On Wed, Jul 18, 2007 at 04:15:46PM +0200, Matthias Koenig wrote:
>> Let mkswap, mkfs.bfs, mkfs.minix open with O_EXCL if
>> used on block devices to prevent writing to the device
>> even if they are busy.
>
> "busy" -- do you mean mounted?

mounted or another process having opened the device with O_EXCL.
I found this summary of what O_EXCL does on block devices,
for reference:
http://lkml.org/lkml/2006/2/5/137

> BTW, mkswap and mkfs.minix are checking against /etc/mtab.
>
> The O_EXCL is not real exclusive lock, it's exclusive lock against
> others O_EXCT accesses only. 

Yes, it's an advisory lock only.
But it should make filesystem creation safer, if all mkfs tools use O_EXCL
on block devices. E.g. mke2fs is also using O_EXCL.

Thanks,
Matthias

-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to