lkml.org 
[lkml]   [1996]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: patch: NFS and O_EXCL. Also: is O_EXCL really atomic?


On 14 Sep 1996, Miquel van Smoorenburg wrote:
>
> This also brings up another question. In the Linux FS code, O_EXCL
> is treated by the VFS layer by first testing if the file is present,
> and then creating the file if not. It looks to me as if it could be
> possible that another process could be scheduled between the test and
> the create. This chance is really small, but still.. I don't know
> enough of the VFS layer to see if this is really true, though.

The semaphore on the directory makes sure that you can't have another
process messing with the directory during the open. As such O_EXCL is
automatically atomic on local filesystems. Networked filesystems need to
handle it their own way (if they handle it at all).

Linus

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.132 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site