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 309488 Details for
Bug 436132
Reduce NFS cache invalidations due to writes from same client
[?]
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]
patch1 - NFS: don't use post_op_attrs from WRITE replies for cache revalidation
01-nfs-don-t-use-post_op_attrs-fr.patch (text/plain), 3.88 KB, created by
Jeff Layton
on 2008-06-16 13:15:05 UTC
(
hide
)
Description:
patch1 - NFS: don't use post_op_attrs from WRITE replies for cache revalidation
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-06-16 13:15:05 UTC
Size:
3.88 KB
patch
obsolete
>NFS: don't use post_op_attrs from WRITE replies for cache revalidation > >From: Jeff Layton <jlayton@redhat.com> > >Only use post_op_attrs from write replies for updating the cached >attributes. Additionally, don't even take the cached attributes if >the mtime in them is older than the current mtime on the inode. >--- > > fs/nfs/inode.c | 33 +++++++++++++++++++++++++++++++++ > fs/nfs/nfs3proc.c | 2 +- > fs/nfs/proc.c | 2 +- > include/linux/nfs_fs.h | 1 + > 4 files changed, 36 insertions(+), 2 deletions(-) > > >diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c >index 596c5d8..4808cea 100644 >--- a/fs/nfs/inode.c >+++ b/fs/nfs/inode.c >@@ -953,6 +953,39 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) > } > > /** >+ * nfs_update_inode_attributes(struct inode *inode, struct nfs_fattr *fattr) >+ * @inode - pointer to inode >+ * @fattr - updated attributes >+ * >+ * Some operations (writes, in particular) will change inode metadata, but >+ * because of ordering problems we can't really trust that the data returned >+ * is current enough to use to revalidate the cache. In this case, we just >+ * want to use it to update the cached attributes, but only if the new mtime >+ * isn't older than the current mtime of the file. This guards against >+ * out of order write replies updating the cache to earlier attributes. >+ **/ >+void >+nfs_update_inode_attributes(struct inode *inode, struct nfs_fattr *fattr) >+{ >+ struct nfs_inode *nfsi = NFS_I(inode); >+ >+ /* only update attrs if mtime isn't older on NFSv2/3 */ >+ if ((fattr->valid & NFS_ATTR_FATTR_V4) != 0 || >+ timespec_compare(&inode->i_mtime, &fattr->mtime) <= 0) { >+ inode->i_size = nfs_size_to_loff_t(fattr->size); >+ inode->i_mode = fattr->mode; >+ inode->i_nlink = fattr->nlink; >+ inode->i_uid = fattr->uid; >+ inode->i_gid = fattr->gid; >+ nfsi->change_attr = fattr->change_attr; >+ memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); >+ memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); >+ memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime)); >+ } >+ nfsi->cache_validity |= NFS_INO_INVALID_ATTR; >+} >+ >+/** > * nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache > * @inode - pointer to inode > * @fattr - updated attributes >diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c >index c3523ad..67b4450 100644 >--- a/fs/nfs/nfs3proc.c >+++ b/fs/nfs/nfs3proc.c >@@ -739,7 +739,7 @@ static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) > if (nfs3_async_handle_jukebox(task, data->inode)) > return -EAGAIN; > if (task->tk_status >= 0) >- nfs_post_op_update_inode_force_wcc(data->inode, data->res.fattr); >+ nfs_update_inode_attributes(data->inode, data->res.fattr); > return 0; > } > >diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c >index 03599bf..412fa7c 100644 >--- a/fs/nfs/proc.c >+++ b/fs/nfs/proc.c >@@ -573,7 +573,7 @@ static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message * > static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) > { > if (task->tk_status >= 0) >- nfs_post_op_update_inode_force_wcc(data->inode, data->res.fattr); >+ nfs_update_inode_attributes(data->inode, data->res.fattr); > return 0; > } > >diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h >index 27d6a8d..051aa04 100644 >--- a/include/linux/nfs_fs.h >+++ b/include/linux/nfs_fs.h >@@ -320,6 +320,7 @@ extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, > struct nfs_fattr *); > extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); > extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); >+extern void nfs_update_inode_attributes(struct inode *inode, struct nfs_fattr *fattr); > extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); > extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); > extern int nfs_permission(struct inode *, int, struct nameidata *);
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 436132
:
297190
|
297191
|
297250
|
297251
|
297252
|
309488
|
309489
|
309490
|
309620