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 298904 Details for
Bug 438676
reduce false NFS cache invalidations due to overlapping write and getattr calls
[?]
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]
upstream patch
0001-NFS-serialize-write-and-getattr-calls.patch (text/plain), 4.22 KB, created by
Jeff Layton
on 2008-03-24 16:35:06 UTC
(
hide
)
Description:
upstream patch
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-03-24 16:35:06 UTC
Size:
4.22 KB
patch
obsolete
>From 5ddb771a2d430e4f4a962d45571c9865fe990eaa Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Mon, 24 Mar 2008 11:21:29 -0400 >Subject: [PATCH] NFS: serialize write and getattr calls > >Add a new rwsem to the nfs_inode and use it to make sure that write and >getattr calls don't overlap. > >Signed-off-by: Jeff Layton <jlayton@redhat.com> >--- > fs/nfs/direct.c | 4 ++++ > fs/nfs/inode.c | 3 +++ > fs/nfs/write.c | 4 ++++ > include/linux/nfs_fs.h | 3 +++ > 4 files changed, 14 insertions(+), 0 deletions(-) > >diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c >index 16844f9..29b3889 100644 >--- a/fs/nfs/direct.c >+++ b/fs/nfs/direct.c >@@ -437,6 +437,7 @@ static void nfs_direct_free_writedata(struct nfs_direct_req *dreq) > static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) > { > struct inode *inode = dreq->inode; >+ struct nfs_inode *nfsi = NFS_I(inode); > struct list_head *p; > struct nfs_write_data *data; > struct rpc_task *task; >@@ -480,6 +481,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) > /* > * We're called via an RPC callback, so BKL is already held. > */ >+ down_read(&nfsi->mtime_sem); > task = rpc_run_task(&task_setup_data); > if (!IS_ERR(task)) > rpc_put_task(task); >@@ -672,6 +674,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq, > { > struct nfs_open_context *ctx = dreq->ctx; > struct inode *inode = ctx->path.dentry->d_inode; >+ struct nfs_inode *nfsi = NFS_I(inode); > unsigned long user_addr = (unsigned long)iov->iov_base; > size_t count = iov->iov_len; > struct rpc_task *task; >@@ -744,6 +747,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq, > msg.rpc_resp = &data->res; > NFS_PROTO(inode)->write_setup(data, &msg); > >+ down_read(&nfsi->mtime_sem); > task = rpc_run_task(&task_setup_data); > if (!IS_ERR(task)) > rpc_put_task(task); >diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c >index c502494..4ae1f2c 100644 >--- a/fs/nfs/inode.c >+++ b/fs/nfs/inode.c >@@ -657,7 +657,9 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) > if (NFS_STALE(inode)) > goto out; > >+ down_write(&nfsi->mtime_sem); > status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr); >+ up_write(&nfsi->mtime_sem); > if (status != 0) { > dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", > inode->i_sb->s_id, >@@ -1201,6 +1203,7 @@ static void init_once(struct kmem_cache * cachep, void *foo) > atomic_set(&nfsi->silly_count, 1); > INIT_HLIST_HEAD(&nfsi->silly_list); > init_waitqueue_head(&nfsi->waitqueue); >+ init_rwsem(&nfsi->mtime_sem); > nfs4_init_once(nfsi); > } > >diff --git a/fs/nfs/write.c b/fs/nfs/write.c >index bed6341..7b2be13 100644 >--- a/fs/nfs/write.c >+++ b/fs/nfs/write.c >@@ -792,6 +792,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req, > int how) > { > struct inode *inode = req->wb_context->path.dentry->d_inode; >+ struct nfs_inode *nfsi = NFS_I(inode); > int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; > int priority = flush_task_priority(how); > struct rpc_task *task; >@@ -846,6 +847,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req, > count, > (unsigned long long)data->args.offset); > >+ down_read(&nfsi->mtime_sem); > task = rpc_run_task(&task_setup_data); > if (!IS_ERR(task)) > rpc_put_task(task); >@@ -1084,11 +1086,13 @@ int nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) > { > struct nfs_writeargs *argp = &data->args; > struct nfs_writeres *resp = &data->res; >+ struct nfs_inode *nfsi = NFS_I(data->inode); > int status; > > dprintk("NFS: %5u nfs_writeback_done (status %d)\n", > task->tk_pid, task->tk_status); > >+ up_read(&nfsi->mtime_sem); > /* > * ->write_done will attempt to use post-op attributes to detect > * conflicting writes by other clients. A strict interpretation >diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h >index f4a0e4c..2794dc0 100644 >--- a/include/linux/nfs_fs.h >+++ b/include/linux/nfs_fs.h >@@ -166,6 +166,9 @@ struct nfs_inode { > struct hlist_head silly_list; > wait_queue_head_t waitqueue; > >+ /* rwsem for serializing write and getattr calls */ >+ struct rw_semaphore mtime_sem; >+ > #ifdef CONFIG_NFS_V4 > struct nfs4_cached_acl *nfs4_acl; > /* NFSv4 state */ >-- >1.5.3.6 >
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 438676
: 298904 |
298916