lkml.org 
[lkml]   [1999]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch to implement getattr [patch]
Alexander Viro <viro@math.psu.edu> wrote:
> > cpio, tar, cp etc. use stat() to check inumbers to find hard links. Of
> > course if inumbers change then they won't find the hard links.
>
> It doesn't happen fast. And such usage of stat() brings a race - you do
> stat() on foo, somebody does rename("bar", "foo"), you do stat() on baz
> and happily decide that foo and baz are identical. They *were* identical,
> all right, but they are different now.

Keeping the files opened wouldn't avoid that race.

Only way to avoid that race is operationally -- don't touch the part of
the system where cpio (or tar, cp, etc.) is playing.

But this operational procedure doesn't solve silliness like fstat
returning same inode for different files on some file systems.

[Not that there is a good solution... on the third hand, I think that
cpio, etc. should be taught to not trust inode numbers being the same
if file size and/or timestamp differ. Which maybe is what you were
getting at.]

--
Raul

-
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.tux.org/lkml/

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