linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's the mean of FMODE_EXCL?
@ 2012-11-21 12:08 majianpeng
  0 siblings, 0 replies; only message in thread
From: majianpeng @ 2012-11-21 12:08 UTC (permalink / raw)
  To: tj; +Cc: linux-fsdevel

Hi all:
	Today, i wrote to a partition which already mounted using dd.So the fs was destroyed completedly.
So i asked why dd can write? I remembed the flag O_EXCL which prevent other operation.
I review the code and found it used FMODE_EXCL.But why dd can write?
In open(2):
>             In  general,  the  behavior  of  O_EXCL is undefined if it is used without O_CREAT.  There is one
>             exception: on Linux 2.6 and later, O_EXCL can be used without O_CREAT if  pathname  refers  to  a
>              block device.  If the block device is in use by the system (e.g., mounted), open() fails with the
>              error EBUSY.
 But understand from the literal meaning, EXCL means opened exclusively.I think it like mutex-operation.
Can someone please tell me why?

Thanks!
Jianpeng

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-21 12:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 12:08 What's the mean of FMODE_EXCL? majianpeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).