[PATCH 0/3] cifs: fix some problems with noserverino + unix extensions
This patchset fixes a number of issues with unix extensions when
"noserverino" is specified. The second patch in the set is one I've
posted before. Steve had previously mentioned that he had concerns
about it, but I think it's the right patch for now.
It would be good to eventually check for and handle the situation
where the uniqueid on a path-based operation changes, but I'm not
sure of the right way to handle that at this point and the current
code is clearly broken -- the server-provided uniqueid's are reported
in stat() calls even when noserverino is specified.
Given that, I think that patch #2 should be taken at this time even
if we don't currently handle inode number changes as well as we
Jeff Layton (3):
cifs: always revalidate hardlinked inodes
cifs: don't update uniqueid in cifs_fattr_to_inode
cifs: fix noserverino handling when unix extensions are enabled
Seems odd to turn off metadata caching completely for hardlinked
files. Wouldn't it be easier, and less invasive, to simply set
cifs_i->time to zero on source and destination inodes when the client
does the hardlink (so we revalidate the first time after the link is
done, but otherwise treat hardlinked files the same, and continue to
allow limited metadata caching on them)?
On Mon, 17 May 2010 10:34:03 -0500
Steve French <[hidden email]> wrote:
> Seems odd to turn off metadata caching completely for hardlinked
> files. Wouldn't it be easier, and less invasive, to simply set
> cifs_i->time to zero on source and destination inodes when the client
> does the hardlink (so we revalidate the first time after the link is
> done, but otherwise treat hardlinked files the same, and continue to
> allow limited metadata caching on them)?
I do agree that this makes little sense, but what you suggest won't
solve the problem. cifs_hardlink already does this:
d_drop(direntry); /* force new lookup from server of target */
cifsInode = CIFS_I(old_file->d_inode);
/* if not oplocked will force revalidate to get info
on source file from srv */
cifsInode->time = 0;
...the reason the test doesn't pass is that the link count doesn't drop
on the inode attached to one of the dentries when you unlink the other.
What probably makes the most sense is to refuse to allow hardlinking of
inodes when noserverino is set, but that might be considered a
regression since older kernels allowed it.
In short, it's a mess but this gets the behavior back to what it was