linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bian Naimeng <biannm@cn.fujitsu.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: [RFC][PATCH] rpc_pipe_msg should be protected by inode->i_lock when purge it.
Date: Tue, 14 Sep 2010 16:59:29 +0800	[thread overview]
Message-ID: <4C8F3971.1050306@cn.fujitsu.com> (raw)

Maybe rpc_pipe_msg should be protected by inode->i_lock when purge the free_list.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 net/sunrpc/rpc_pipe.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 8d63f8f..24b2714 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -47,8 +47,10 @@ static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
 		return;
 	do {
 		msg = list_entry(head->next, struct rpc_pipe_msg, list);
+		spin_lock(&rpci->vfs_inode->i_lock);
 		list_del(&msg->list);
 		msg->errno = err;
+		spin_unlock(&rpci->vfs_inode->i_lock);
 		destroy_msg(msg);
 	} while (!list_empty(head));
 	wake_up(&rpci->waitq);
-- 
1.6.5.2



-- 
Regards
Bian Naimeng


             reply	other threads:[~2010-09-14  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14  8:59 Bian Naimeng [this message]
2010-09-14 12:58 ` [RFC][PATCH] rpc_pipe_msg should be protected by inode->i_lock when purge it Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C8F3971.1050306@cn.fujitsu.com \
    --to=biannm@cn.fujitsu.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).