mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alessio Igor Bogani <abogani@texware.it>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Jonathan Corbet" <corbet@lwn.net>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	"Alessio Igor Bogani" <abogani@texware.it>
Subject: [PATCH] remove the BKL: remove "BKL auto-drop" assumption from nfs3_rpc_wrapper()
Date: Fri, 10 Apr 2009 18:34:41 +0200	[thread overview]
Message-ID: <1239381281-11282-1-git-send-email-abogani@texware.it> (raw)

Fix nfs3_rpc_wrapper()'s "schedule() drops the BKL automatically" assumption,
when schedule_timeout_killable() does not do that it can lock up.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
 fs/nfs/nfs3proc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index d0cc5ce..d91047c 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -17,6 +17,7 @@
 #include <linux/nfs_page.h>
 #include <linux/lockd/bind.h>
 #include <linux/nfs_mount.h>
+#include <linux/smp_lock.h>
 
 #include "iostat.h"
 #include "internal.h"
@@ -28,11 +29,17 @@ static int
 nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
 {
 	int res;
+	int bkl = kernel_locked();
+
 	do {
 		res = rpc_call_sync(clnt, msg, flags);
 		if (res != -EJUKEBOX)
 			break;
+		if (bkl)
+			unlock_kernel();
 		schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
+		if (bkl)
+			lock_kernel();
 		res = -ERESTARTSYS;
 	} while (!fatal_signal_pending(current));
 	return res;
-- 
1.6.0.4


             reply	other threads:[~2009-04-10 16:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10 16:34 Alessio Igor Bogani [this message]
2009-04-10 18:29 ` Frederic Weisbecker
2009-04-10 20:50   ` Alessio Igor Bogani
2009-04-12 13:59     ` Ingo Molnar
2009-04-12 20:34       ` Alessio Igor Bogani
2009-04-13  5:53         ` Frederic Weisbecker

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=1239381281-11282-1-git-send-email-abogani@texware.it \
    --to=abogani@texware.it \
    --cc=a.p.zijlstra@chello.nl \
    --cc=corbet@lwn.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®