[linux-cifs-client] [PATCH 0/8] cifs: fix pagecache revalidation
Jeff Layton
jlayton at redhat.com
Thu Feb 11 12:58:42 MST 2010
Petr Vandrovec opened a kernel.org bugzilla case saying that he was
occasionally seeing stale data in files:
http://bugzilla.kernel.org/show_bug.cgi?id=15088
At first, I thought the problem was probably the issue with the dentry
hashing, but he was still able to reproduce the problem even with those
fixes in place. After some good data collection on his part during this
event, I determined that the cause seemed to be that the revalidation
code was just plain broken.
Here's the problem -- when we get new attributes for a file, we copy
those attributes to the inode in cifs_fattr_to_inode. Cache invalidation
however happens in cifs_revalidate. If the attributes are updated via
any other codepath than cifs_revalidate, then it's possible that
cifs_revalidate won't notice any changes when it is run.
This patchset is an attempt to fix this and to be a little more careful
about checking the cache validity prior to depending on cached data.
Tested with Connectathon primarily and stress tested with fsstress. I'd
like to see this considered for inclusion in 2.6.34.
Jeff Layton (8):
cifs: set server_eof in cifs_fattr_to_inode
cifs: overhaul cifs_revalidate and rename to cifs_revalidate_dentry
cifs: add a CIFSSMBQFileInfo function
cifs: add a CIFSSMBUnixQFileInfo function
cifs: add cifs_revalidate_file
cifs: add aio_read wrapper for cifs
cifs: add revalidation wrapper for splice_read
cifs: clean up d_revalidate error return
fs/cifs/cifsfs.c | 15 ++--
fs/cifs/cifsfs.h | 8 ++-
fs/cifs/cifsglob.h | 1 +
fs/cifs/cifsproto.h | 6 +
fs/cifs/cifssmb.c | 133 +++++++++++++++++++++++
fs/cifs/dir.c | 8 +-
fs/cifs/file.c | 41 +++++++-
fs/cifs/inode.c | 298 +++++++++++++++++++++++++++++++-------------------
8 files changed, 385 insertions(+), 125 deletions(-)
More information about the linux-cifs-client
mailing list