Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 246911 Details for
Bug 364351
NFS: Fix directory caching problem - with test case and patch.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- discard pagecahe for dirs on dentry iput
0020-BZ-327591-NFS-discard-pagecache-data-for-dirs-on-d.patch (text/plain), 3.30 KB, created by
Jeff Layton
on 2007-11-02 17:55:41 UTC
(
hide
)
Description:
patch -- discard pagecahe for dirs on dentry iput
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-11-02 17:55:41 UTC
Size:
3.30 KB
patch
obsolete
>From c686036444a472ef804ef67eeee8f06310247abf Mon Sep 17 00:00:00 2001 >From: Neil Brown <neilb@suse.de> >Date: Mon, 26 Feb 2007 12:48:25 +1100 >Subject: [PATCH] BZ#327591: NFS: discard pagecache data for dirs on dentry_iput > >Try running this script in an NFS mounted directory (Client relatively >recent - 2.6.18 has the problem as does 2.6.20). > >------------------------------------------------------ > >rm -rf nfstest >mkdir -p nfstest/dir/innerdir > >echo "Hello World!" >nfstest/dir/file >echo "Hello World!" >nfstest/dir/innerdir/innerfile > >sleep 1 > >chmod -R a+r nfstest > >mv nfstest/dir nfstest/newdir > >tar -cf nfstest/nfstest.tar -C nfstest newdir > >mv nfstest/newdir nfstest/dir >-------------------------------------------------------- > >What happens: > >The 'chmod -R' does a readdir_plus in each directory and the results >get cached in the page cache. It then updates the ctime on each file >by one second. When this happens, the post-op attributes are used to >update the ctime stored on the client to match the value in the kernel. > >The 'mv' calls shrink_dcache_parent on the directory tree which >flushes all the dentries (so a new lookup will be required) but >doesn't flush the inodes or pagecache. > >The 'tar' does a readdir on each directory, but (in the case of >'innerdir' at least) satisfies it from the pagecache and uses the >READDIRPLUS data to update all the inodes. In the case of >'innerdir/innerfile', the ctime is out of date. > >'tar' then calls 'lstat' on innerdir/innerfile getting an old ctime. >It then opens the file (triggering a GETATTR), reads the content, and >then calls fstat to see if anything has changed. It finds that ctime >has changed and so complains. > >The problem seems to be that the cache readdirplus info is kept around >for too long. > >My patch below discards pagecache data for directories when >dentry_iput is called on them. This effectively removes the symptom >which convinces me that I correctly understand the problem. However >I'm not convinced that is a proper solution, as there could easily be >other races that trigger the same problem without being affected by >this 'fix'. > >One possibility would be to require that readdirplus pagecache data be >only used *once* to instantiate an inode. Somehow it should then be >invalidated so that if the dentry subsequently disappears, it will >cause a new request to the server to fill in the stat data. > >Another possibility is to compare the cache_change_attribute on the >inode with something similar for the readdirplus info and reject the >info from readdirplus if it is too old. > >I haven't tried to implement these and would value other opinions >before I do. > >Thanks, >NeilBrown > >Signed-off-by: Neil Brown <neilb@suse.de> >Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> >--- > fs/nfs/dir.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > >diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c >index 4f4a11a..0fa248a 100644 >--- a/fs/nfs/dir.c >+++ b/fs/nfs/dir.c >@@ -822,6 +822,10 @@ static int nfs_dentry_delete(struct dentry *dentry) > static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode) > { > nfs_inode_return_delegation(inode); >+ if (S_ISDIR(inode->i_mode)) >+ /* drop any readdir cache as it could easily be old */ >+ NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA; >+ > if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { > lock_kernel(); > inode->i_nlink--; >-- >1.5.3.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 364351
: 246911