lkml.org 
[lkml]   [1998]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Races in open(2)
Date
> Does retrying the operation mean retrying with the original filename, or with the
> original file? If the operation was to delete /tmp/junkfile, now renamed to
> /goodstuff/best_ever, should we follow the dentry to the new name and delete it?
>

I don't think too much arises. An open is atomic, an unlink is atomic, a
rename is atomic. The directory moves before or after the operation not
during. We get to pick if we want to present the move as before or after.

So a rename of the parent of an open is valid. We either open the file in
the new name space or return -ENOENT. [According to the order we present].
Similarly with unlink, mkdir, rmdir.

We do however also have to cover paths relative to '.' - where moves
higher in the name tree do not have any affect on our open anyway, and
threads doing a chdir or chroot while another thread opens. That part of
our dentry path is capable of changing above us and should rightfully do so
without affecting a pending operation and where it goes.

We have no "frename" or "funlink" (fortunately ;)), so the only really
horrible one appears to be umount(). And the semantics of umount arent
even defined in the single unix spec.

Alan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

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