> I was referring to your statement "constant inumbers during the life of
> an *open* file" -- it suggests the inumbers may change when the file is
> not open.
s/file not open/inode purged from icache/
> 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.
> > Yes, it is. Internally FAT uses the directory entry location as the key.
> > Glue in fs/fat/inode.c allows icache to keep constant i_ino and have its
> > way wrt purging, etc. IIRC I've posted a description of this stuff on
> > linux-fsdevel back in April or May. Look through archives - fsdevel is not
> > too noisy.
>
> Isn't there problem that if the file is renamed, then leaves the kernel
> cache, and is brought back by a later stat(), it gets a different ino?
rename() has nothing with it. Internal cache is slave to icache - when
inode is going to be purged it leaves the internal cache. Forcibly. Glue
allows to do it safely - look at the posting I refered to and you'll see
how it's done.
-
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/