From: Alessio Igor Bogani <abogani@texware.it>
To: Alexander Viro <viro@zeniv.linux.org.uk>
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>,
LFSDEV <linux-fsdevel@vger.kernel.org>,
"Ingo Molnar" <mingo@elte.hu>, "Matthew Wilcox" <matthew@wil.cx>,
"Alessio Igor Bogani" <abogani@texware.it>
Subject: [PATCH 1/1] vfs: umount_begin BKL pushdown v2
Date: Fri, 24 Apr 2009 09:06:53 +0200 [thread overview]
Message-ID: <1240556813-8739-2-git-send-email-abogani@texware.it> (raw)
In-Reply-To: <1240556813-8739-1-git-send-email-abogani@texware.it>
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
fs/9p/vfs_super.c | 6 +++++-
fs/cifs/cifsfs.c | 15 ++++++++++++---
fs/fuse/inode.c | 3 +++
fs/namespace.c | 2 --
fs/nfs/super.c | 7 ++++++-
5 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 5f8ab8a..7d23214 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -37,6 +37,7 @@
#include <linux/mount.h>
#include <linux/idr.h>
#include <linux/sched.h>
+#include <linux/smp_lock.h>
#include <net/9p/9p.h>
#include <net/9p/client.h>
@@ -230,9 +231,12 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt)
static void
v9fs_umount_begin(struct super_block *sb)
{
- struct v9fs_session_info *v9ses = sb->s_fs_info;
+ struct v9fs_session_info *v9ses;
+ lock_kernel();
+ v9ses = sb->s_fs_info;
v9fs_session_cancel(v9ses);
+ unlock_kernel();
}
static const struct super_operations v9fs_super_ops = {
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 0d6d8b5..eef568c 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -35,6 +35,7 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
+#include <linux/smp_lock.h>
#include "cifsfs.h"
#include "cifspdu.h"
#define DECLARE_GLOBALS_HERE
@@ -520,15 +521,22 @@ static struct quotactl_ops cifs_quotactl_ops = {
static void cifs_umount_begin(struct super_block *sb)
{
- struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+ struct cifs_sb_info *cifs_sb;
struct cifsTconInfo *tcon;
- if (cifs_sb == NULL)
+ lock_kernel();
+ cifs_sb = CIFS_SB(sb);
+
+ if (cifs_sb == NULL) {
+ unlock_kernel();
return;
+ }
tcon = cifs_sb->tcon;
- if (tcon == NULL)
+ if (tcon == NULL) {
+ unlock_kernel();
return;
+ }
read_lock(&cifs_tcp_ses_lock);
if (tcon->tc_count == 1)
@@ -548,6 +556,7 @@ static void cifs_umount_begin(struct super_block *sb)
}
/* BB FIXME - finish add checks for tidStatus BB */
+ unlock_kernel();
return;
}
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 459b73d..d1bc4d3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -19,6 +19,7 @@
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/exportfs.h>
+#include <linux/smp_lock.h>
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -259,7 +260,9 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
static void fuse_umount_begin(struct super_block *sb)
{
+ lock_kernel();
fuse_abort_conn(get_fuse_conn_super(sb));
+ unlock_kernel();
}
static void fuse_send_destroy(struct fuse_conn *fc)
diff --git a/fs/namespace.c b/fs/namespace.c
index 4119620..0d2003f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1073,9 +1073,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
*/
if (flags & MNT_FORCE && sb->s_op->umount_begin) {
- lock_kernel();
sb->s_op->umount_begin(sb);
- unlock_kernel();
}
/*
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 6717200..1679a16 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -683,9 +683,12 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
*/
static void nfs_umount_begin(struct super_block *sb)
{
- struct nfs_server *server = NFS_SB(sb);
+ struct nfs_server *server;
struct rpc_clnt *rpc;
+ lock_kernel();
+
+ server = NFS_SB(sb);
/* -EIO all pending I/O */
rpc = server->client_acl;
if (!IS_ERR(rpc))
@@ -693,6 +696,8 @@ static void nfs_umount_begin(struct super_block *sb)
rpc = server->client;
if (!IS_ERR(rpc))
rpc_killall_tasks(rpc);
+
+ unlock_kernel();
}
/*
--
1.6.0.4
next prev parent reply other threads:[~2009-04-24 7:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-23 19:12 [PATCH 0/5 -tip] umount_begin BKL pushdown Alessio Igor Bogani
2009-04-23 19:12 ` [PATCH 1/5 -tip] 9p: " Alessio Igor Bogani
2009-04-23 19:12 ` [PATCH 2/5 -tip] cifs: " Alessio Igor Bogani
2009-04-23 19:12 ` [PATCH 3/5 -tip] fuse: " Alessio Igor Bogani
2009-04-23 19:12 ` [PATCH 4/5 -tip] nfs: " Alessio Igor Bogani
2009-04-23 19:12 ` [PATCH 5/5 -tip] vfs: Don-t call umount_begin with BKL held Alessio Igor Bogani
2009-04-23 19:15 ` [PATCH 2/5 -tip] cifs: umount_begin BKL pushdown Al Viro
2009-04-23 19:19 ` Matthew Wilcox
2009-04-24 7:06 ` [PATCH 0/1] vfs: umount_begin BKL pushdown v2 Alessio Igor Bogani
2009-04-24 7:06 ` Alessio Igor Bogani [this message]
2009-04-24 7:13 ` [PATCH 1/1] " Al Viro
2009-04-24 7:15 ` Al Viro
2009-04-24 8:48 ` Christoph Hellwig
2009-04-24 7:18 ` Al Viro
2009-04-24 7:41 ` Alessio Igor Bogani
2009-04-24 8:06 ` Ingo Molnar
2009-04-24 8:50 ` Christoph Hellwig
2009-04-24 9:16 ` Frédéric Weisbecker
2009-04-24 17:50 ` Christoph Hellwig
2009-04-24 18:55 ` Al Viro
2009-04-24 19:02 ` Christoph Hellwig
2009-04-24 20:43 ` Al Viro
2009-04-24 22:07 ` Ingo Molnar
2009-04-24 22:49 ` Ingo Molnar
2009-04-24 13:58 ` Al Viro
2009-04-24 22:19 ` Ingo Molnar
2009-04-25 7:16 ` Al Viro
2009-04-23 19:18 ` [PATCH 0/5 -tip] umount_begin BKL pushdown Al Viro
2009-04-23 21:32 ` Ingo Molnar
2009-04-24 1:57 ` Stephen Rothwell
2009-04-24 14:31 ` Jonathan Corbet
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=1240556813-8739-2-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-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=viro@zeniv.linux.org.uk \
/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).