All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] more BKL removal after get_sb pushdown
@ 2010-09-16 17:46 Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 01/12] BKL: Remove BKL from usbfs Arnd Bergmann
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Jan Blunck, OGAWA Hirofumi,
	H. Peter Anvin, reiserfs-devel, netdev, David Brownell,
	linux-usb, linux-afs, David Howells, Dustin Kirkland,
	Tyler Hicks, ecryptfs-devel, David Woodhouse, Phillip Lougher,
	Mark Fasheh, Joel Becker, linux-fsdevel

These patches have not been posted yet, I did some of them
only when going through the list of remaining BKL users and
found them to be simple to fix myself.

Most of these patches only apply on top of the pushdown into
the get_sb operation, which is now in linux-next, so I'm
planning to keep them in the same series instead of
going through maintainer trees.

The full series can be found in
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl.git vfs

Arnd Bergmann (12):
  BKL: Remove BKL from usbfs
  BKL: Remove BKL from fat
  BKL: Remove BKL from isofs
  BKL: Remove BKL from autofs4
  BKL: Remove BKL from ReiserFS
  BKL: Remove BKL from capifs
  BKL: Remove BKL from USB gadgetfs
  BKL: Remove BKL from afs
  BKL: Remove BKL from ecryptfs
  BKL: Remove BKL from jffs2
  BKL: Remove BKL from squashfs
  BKL: Remove BKL from OCFS2

 drivers/isdn/capi/capifs.c |    8 +-------
 drivers/usb/core/inode.c   |    6 ------
 drivers/usb/gadget/inode.c |   13 ++-----------
 fs/afs/super.c             |   10 ----------
 fs/autofs4/root.c          |   12 +++++++-----
 fs/ecryptfs/file.c         |    3 ---
 fs/ecryptfs/main.c         |    4 ----
 fs/fat/inode.c             |    5 -----
 fs/fat/namei_msdos.c       |    7 +++----
 fs/fat/namei_vfat.c        |    7 +++----
 fs/isofs/dir.c             |    6 +++---
 fs/isofs/inode.c           |   16 ++++++----------
 fs/isofs/namei.c           |    8 ++++----
 fs/isofs/rock.c            |    8 ++++----
 fs/jffs2/fs.c              |    4 ----
 fs/jffs2/super.c           |   12 +-----------
 fs/ocfs2/dlmfs/dlmfs.c     |    9 +--------
 fs/ocfs2/stack_user.c      |    3 ---
 fs/ocfs2/super.c           |   12 ------------
 fs/reiserfs/super.c        |    6 ------
 fs/squashfs/super.c        |   11 -----------
 21 files changed, 35 insertions(+), 135 deletions(-)

Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jan Blunck <jblunck@infradead.org>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Jan Blunck <jblunck@infradead.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: reiserfs-devel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: linux-usb@vger.kernel.org
Cc: linux-afs@lists.infradead.org
Cc: David Howells <dhowells@redhat.com>
Cc: Dustin Kirkland <kirkland@canonical.com>
Cc: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: ecryptfs-devel@lists.launchpad.net
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
Cc: linux-fsdevel@vger.kernel.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 01/12] BKL: Remove BKL from usbfs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 18:47   ` Greg KH
  2010-09-16 17:46 ` [PATCH 02/12] BKL: Remove BKL from fat Arnd Bergmann
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Greg Kroah-Hartman, Jan Blunck

Nothing in there has a race that can be
prevented by holding the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jan Blunck <jblunck@infradead.org>
---
 drivers/usb/core/inode.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 73ec8c2..9e2ec9f 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -39,7 +39,6 @@
 #include <linux/parser.h>
 #include <linux/notifier.h>
 #include <linux/seq_file.h>
-#include <linux/smp_lock.h>
 #include <linux/usb/hcd.h>
 #include <asm/byteorder.h>
 #include "usb.h"
@@ -457,8 +456,6 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
 	struct inode *inode;
 	struct dentry *root;
 
-	lock_kernel();
-
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	sb->s_magic = USBDEVICE_SUPER_MAGIC;
@@ -468,7 +465,6 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
 
 	if (!inode) {
 		dbg("%s: could not get inode!",__func__);
-		unlock_kernel();
 		return -ENOMEM;
 	}
 
@@ -476,11 +472,9 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
 	if (!root) {
 		dbg("%s: could not get root dentry!",__func__);
 		iput(inode);
-		unlock_kernel();
 		return -ENOMEM;
 	}
 	sb->s_root = root;
-	unlock_kernel();
 	return 0;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 02/12] BKL: Remove BKL from fat
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 01/12] BKL: Remove BKL from usbfs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 03/12] BKL: Remove BKL from isofs Arnd Bergmann
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, OGAWA Hirofumi, Jan Blunck

The lock_kernel in fat_put_super is not needed because
it only protects the super block itself and we know that
no other thread can reach it because we are about to
kfree the object.

In the two fill_super functions, this converts the locking
to use lock_super like elsewhere in the fat code. This
is probably not needed either, but is consistent and puts
us on the safe side.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Jan Blunck <jblunck@infradead.org>
---
 fs/fat/inode.c       |    5 -----
 fs/fat/namei_msdos.c |    7 +++----
 fs/fat/namei_vfat.c  |    7 +++----
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8300580..ad6998a 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/seq_file.h>
 #include <linux/pagemap.h>
 #include <linux/mpage.h>
@@ -489,8 +488,6 @@ static void fat_put_super(struct super_block *sb)
 {
 	struct msdos_sb_info *sbi = MSDOS_SB(sb);
 
-	lock_kernel();
-
 	if (sb->s_dirt)
 		fat_write_super(sb);
 
@@ -504,8 +501,6 @@ static void fat_put_super(struct super_block *sb)
 
 	sb->s_fs_info = NULL;
 	kfree(sbi);
-
-	unlock_kernel();
 }
 
 static struct kmem_cache *fat_inode_cachep;
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index e2b0b97..bbca5c1 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <linux/time.h>
 #include <linux/buffer_head.h>
-#include <linux/smp_lock.h>     /* For lock_kernel() */
 #include "fat.h"
 
 /* Characters that are undesirable in an MS-DOS file name */
@@ -663,16 +662,16 @@ static int msdos_fill_super(struct super_block *sb, void *data, int silent)
 {
 	int res;
 
-	lock_kernel();
+	lock_super(sb);
 	res = fat_fill_super(sb, data, silent, &msdos_dir_inode_operations, 0);
 	if (res) {
-		unlock_kernel();
+		unlock_super(sb);
 		return res;
 	}
 
 	sb->s_flags |= MS_NOATIME;
 	sb->s_root->d_op = &msdos_dentry_operations;
-	unlock_kernel();
+	unlock_super(sb);
 	return 0;
 }
 
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 9006ad9..6f0f6c9 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -21,7 +21,6 @@
 #include <linux/slab.h>
 #include <linux/buffer_head.h>
 #include <linux/namei.h>
-#include <linux/smp_lock.h>     /* For lock_kernel() */
 #include "fat.h"
 
 /*
@@ -1056,10 +1055,10 @@ static int vfat_fill_super(struct super_block *sb, void *data, int silent)
 {
 	int res;
 
-	lock_kernel();
+	lock_super(sb);
 	res = fat_fill_super(sb, data, silent, &vfat_dir_inode_operations, 1);
 	if (res) {
-		unlock_kernel();
+		unlock_super(sb);
 		return res;
 	}
 
@@ -1068,7 +1067,7 @@ static int vfat_fill_super(struct super_block *sb, void *data, int silent)
 	else
 		sb->s_root->d_op = &vfat_dentry_ops;
 
-	unlock_kernel();
+	unlock_super(sb);
 	return 0;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 03/12] BKL: Remove BKL from isofs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 01/12] BKL: Remove BKL from usbfs Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 02/12] BKL: Remove BKL from fat Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 04/12] BKL: Remove BKL from autofs4 Arnd Bergmann
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann

As in other file systems, we can replace the big kernel lock
with {un,}lock_super in isofs. This means we can now access
multiple file systems concurrently, but it also means that
we serialize readdir and lookup across sleeping operations
which previously released the big kernel lock. This should
not matter though, as these operations are in practice
serialized through the hardware access.

The isofs_get_blocks functions now does not take any lock
any more, it used to recursively get the BKL. After looking
at the code for hours, I convinced myself that it was never
needed here anyway, because it only reads constant fields
of the inode and writes to a buffer head array that is
at this time only visible to the caller.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/isofs/dir.c   |    6 +++---
 fs/isofs/inode.c |   16 ++++++----------
 fs/isofs/namei.c |    8 ++++----
 fs/isofs/rock.c  |    8 ++++----
 4 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index e0aca9a..4e6c000 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -10,7 +10,6 @@
  *
  *  isofs directory handling functions
  */
-#include <linux/smp_lock.h>
 #include <linux/gfp.h>
 #include "isofs.h"
 
@@ -255,18 +254,19 @@ static int isofs_readdir(struct file *filp,
 	char *tmpname;
 	struct iso_directory_record *tmpde;
 	struct inode *inode = filp->f_path.dentry->d_inode;
+	struct super_block *sb = inode->i_sb;
 
 	tmpname = (char *)__get_free_page(GFP_KERNEL);
 	if (tmpname == NULL)
 		return -ENOMEM;
 
-	lock_kernel();
+	lock_super(sb);
 	tmpde = (struct iso_directory_record *) (tmpname+1024);
 
 	result = do_isofs_readdir(inode, filp, dirent, filldir, tmpname, tmpde);
 
 	free_page((unsigned long) tmpname);
-	unlock_kernel();
+	unlock_super(sb);
 	return result;
 }
 
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 05baf77..57209f1 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -17,7 +17,6 @@
 #include <linux/slab.h>
 #include <linux/nls.h>
 #include <linux/ctype.h>
-#include <linux/smp_lock.h>
 #include <linux/statfs.h>
 #include <linux/cdrom.h>
 #include <linux/parser.h>
@@ -44,11 +43,11 @@ static void isofs_put_super(struct super_block *sb)
 	struct isofs_sb_info *sbi = ISOFS_SB(sb);
 
 #ifdef CONFIG_JOLIET
-	lock_kernel();
+	lock_super(sb);
 
 	unload_nls(sbi->s_nls_iocharset);
 
-	unlock_kernel();
+	unlock_super(sb);
 #endif
 
 	kfree(sbi);
@@ -571,13 +570,13 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
 	int table, error = -EINVAL;
 	unsigned int vol_desc_start;
 
-	lock_kernel();
+	lock_super(s);
 
 	save_mount_options(s, data);
 
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi) {
-		unlock_kernel();
+		unlock_super(s);
 		return -ENOMEM;
 	}
 	s->s_fs_info = sbi;
@@ -904,7 +903,7 @@ root_found:
 
 	kfree(opt.iocharset);
 
-	unlock_kernel();
+	unlock_super(s);
 	return 0;
 
 	/*
@@ -942,9 +941,9 @@ out_freebh:
 	brelse(bh);
 out_freesbi:
 	kfree(opt.iocharset);
+	unlock_super(s);
 	kfree(sbi);
 	s->s_fs_info = NULL;
-	unlock_kernel();
 	return error;
 }
 
@@ -983,8 +982,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
 	int section, rv, error;
 	struct iso_inode_info *ei = ISOFS_I(inode);
 
-	lock_kernel();
-
 	error = -EIO;
 	rv = 0;
 	if (iblock < 0 || iblock != iblock_s) {
@@ -1060,7 +1057,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
 
 	error = 0;
 abort:
-	unlock_kernel();
 	return rv != 0 ? rv : error;
 }
 
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index ab438be..cf67973 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -6,7 +6,6 @@
  *  (C) 1991  Linus Torvalds - minix filesystem
  */
 
-#include <linux/smp_lock.h>
 #include <linux/gfp.h>
 #include "isofs.h"
 
@@ -168,6 +167,7 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
 	int found;
 	unsigned long uninitialized_var(block);
 	unsigned long uninitialized_var(offset);
+	struct super_block *sb = dir->i_sb;
 	struct inode *inode;
 	struct page *page;
 
@@ -177,7 +177,7 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
 	if (!page)
 		return ERR_PTR(-ENOMEM);
 
-	lock_kernel();
+	lock_super(sb);
 	found = isofs_find_entry(dir, dentry,
 				&block, &offset,
 				page_address(page),
@@ -188,10 +188,10 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
 	if (found) {
 		inode = isofs_iget(dir->i_sb, block, offset);
 		if (IS_ERR(inode)) {
-			unlock_kernel();
+			unlock_super(sb);
 			return ERR_CAST(inode);
 		}
 	}
-	unlock_kernel();
+	unlock_super(sb);
 	return d_splice_alias(inode, dentry);
 }
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 96a685c..0599c65 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -8,7 +8,6 @@
 
 #include <linux/slab.h>
 #include <linux/pagemap.h>
-#include <linux/smp_lock.h>
 
 #include "isofs.h"
 #include "rock.h"
@@ -661,6 +660,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 {
 	struct inode *inode = page->mapping->host;
 	struct iso_inode_info *ei = ISOFS_I(inode);
+	struct super_block *sb = inode->i_sb;
 	char *link = kmap(page);
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
 	struct buffer_head *bh;
@@ -678,7 +678,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 
 	init_rock_state(&rs, inode);
 	block = ei->i_iget5_block;
-	lock_kernel();
+	lock_super(sb);
 	bh = sb_bread(inode->i_sb, block);
 	if (!bh)
 		goto out_noread;
@@ -748,7 +748,7 @@ repeat:
 		goto fail;
 	brelse(bh);
 	*rpnt = '\0';
-	unlock_kernel();
+	unlock_super(sb);
 	SetPageUptodate(page);
 	kunmap(page);
 	unlock_page(page);
@@ -765,7 +765,7 @@ out_bad_span:
 	printk("symlink spans iso9660 blocks\n");
 fail:
 	brelse(bh);
-	unlock_kernel();
+	unlock_super(sb);
 error:
 	SetPageError(page);
 	kunmap(page);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (2 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 03/12] BKL: Remove BKL from isofs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:49   ` H. Peter Anvin
  2010-09-16 17:46 ` [PATCH 05/12] BKL: Remove BKL from ReiserFS Arnd Bergmann
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, H. Peter Anvin

autofs4 uses the BKL only to guard its ioctl operations.
This can be trivially converted to use a mutex, as we have
done with most device drivers before.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
 fs/autofs4/root.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index cb1bd38..9dd29c2 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -19,7 +19,7 @@
 #include <linux/param.h>
 #include <linux/time.h>
 #include <linux/compat.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 
 #include "autofs_i.h"
 
@@ -978,15 +978,17 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp,
 	}
 }
 
+static DEFINE_MUTEX(autofs4_ioctl_mutex);
+
 static long autofs4_root_ioctl(struct file *filp,
 			       unsigned int cmd, unsigned long arg)
 {
 	long ret;
 	struct inode *inode = filp->f_dentry->d_inode;
 
-	lock_kernel();
+	mutex_lock(&autofs4_ioctl_mutex);
 	ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
-	unlock_kernel();
+	mutex_unlock(&autofs4_ioctl_mutex);
 
 	return ret;
 }
@@ -998,13 +1000,13 @@ static long autofs4_root_compat_ioctl(struct file *filp,
 	struct inode *inode = filp->f_path.dentry->d_inode;
 	int ret;
 
-	lock_kernel();
+	mutex_lock(&autofs4_ioctl_mutex);
 	if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL)
 		ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
 	else
 		ret = autofs4_root_ioctl_unlocked(inode, filp, cmd,
 			(unsigned long)compat_ptr(arg));
-	unlock_kernel();
+	mutex_unlock(&autofs4_ioctl_mutex);
 
 	return ret;
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 05/12] BKL: Remove BKL from ReiserFS
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (3 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 04/12] BKL: Remove BKL from autofs4 Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 06/12] BKL: Remove BKL from capifs Arnd Bergmann
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, reiserfs-devel

The BKL only got into reiserfs through the pushdown into
->fill_super. This function is already sufficiently
serialized using reiserfs_write_lock(), so we can
safely remove the BKL here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: reiserfs-devel@vger.kernel.org
---
 fs/reiserfs/super.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 6874489..b8df814 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -28,7 +28,6 @@
 #include <linux/mount.h>
 #include <linux/namei.h>
 #include <linux/crc32.h>
-#include <linux/smp_lock.h>
 
 struct file_system_type reiserfs_fs_type;
 
@@ -1628,8 +1627,6 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 	char *qf_names[MAXQUOTAS] = {};
 	unsigned int qfmt = 0;
 
-	lock_kernel();
-
 	save_mount_options(s, data);
 
 	sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
@@ -1887,8 +1884,6 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 	spin_lock_init(&sbi->bitmap_lock);
 
 	reiserfs_write_unlock(s);
-
-	unlock_kernel();
 	return (0);
 
 error:
@@ -1911,7 +1906,6 @@ error:
 	kfree(sbi);
 
 	s->s_fs_info = NULL;
-	unlock_kernel();
 	return errval;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 06/12] BKL: Remove BKL from capifs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (4 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 05/12] BKL: Remove BKL from ReiserFS Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-17 23:35   ` David Miller
  2010-09-16 17:46 ` [PATCH 07/12] BKL: Remove BKL from USB gadgetfs Arnd Bergmann
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, netdev

The BKL is only used in fill_super, which is  protected by the superblocks
s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: netdev@vger.kernel.org
---
 drivers/isdn/capi/capifs.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c
index c559b52..b0dcdbc 100644
--- a/drivers/isdn/capi/capifs.c
+++ b/drivers/isdn/capi/capifs.c
@@ -17,7 +17,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/sched.h>	/* current */
-#include <linux/smp_lock.h>	/* For lock_kernel() */
 
 #include "capifs.h"
 
@@ -100,8 +99,6 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct inode * inode;
 
-	lock_kernel();
-
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
 	s->s_magic = CAPIFS_SUPER_MAGIC;
@@ -119,15 +116,12 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
 	inode->i_nlink = 2;
 
 	s->s_root = d_alloc_root(inode);
-	if (s->s_root) {
-		unlock_kernel();
+	if (s->s_root)
 		return 0;
-	}
 
 	printk("capifs: get root dentry failed\n");
 	iput(inode);
 fail:
-	unlock_kernel();
 	return -ENOMEM;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 07/12] BKL: Remove BKL from USB gadgetfs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (5 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 06/12] BKL: Remove BKL from capifs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 08/12] BKL: Remove BKL from afs Arnd Bergmann
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, David Brownell, linux-usb

The BKL is only used in fill_super, which is  protected by the superblocks
s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/gadget/inode.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 82a88d3..3f1d771 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -33,7 +33,6 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
-#include <linux/smp_lock.h>
 
 #include <linux/device.h>
 #include <linux/moduleparam.h>
@@ -2043,19 +2042,13 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
 	struct dentry	*d;
 	struct dev_data	*dev;
 
-	lock_kernel();
-
-	if (the_device) {
-		unlock_kernel();
+	if (the_device)
 		return -ESRCH;
-	}
 
 	/* fake probe to determine $CHIP */
 	(void) usb_gadget_register_driver (&probe_driver);
-	if (!CHIP) {
-		unlock_kernel();
+	if (!CHIP)
 		return -ENODEV;
-	}
 
 	/* superblock */
 	sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -2092,7 +2085,6 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
 	 * from binding to a controller.
 	 */
 	the_device = dev;
-	unlock_kernel();
 	return 0;
 
 enomem3:
@@ -2102,7 +2094,6 @@ enomem2:
 enomem1:
 	iput (inode);
 enomem0:
-	unlock_kernel();
 	return -ENOMEM;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 08/12] BKL: Remove BKL from afs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (6 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 07/12] BKL: Remove BKL from USB gadgetfs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 09/12] BKL: Remove BKL from ecryptfs Arnd Bergmann
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, linux-afs, David Howells

The BKL is only used in put_super and fill_super, which are both protected
by the superblocks s_umount rw_semaphore. Therefore it is safe to remove
the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-afs@lists.infradead.org
Cc: David Howells <dhowells@redhat.com>
---
 fs/afs/super.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/fs/afs/super.c b/fs/afs/super.c
index 6c2fef4..eacf76d 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -19,7 +19,6 @@
 #include <linux/mount.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/parser.h>
@@ -302,15 +301,12 @@ static int afs_fill_super(struct super_block *sb, void *data)
 	struct inode *inode = NULL;
 	int ret;
 
-	lock_kernel();
-
 	_enter("");
 
 	/* allocate a superblock info record */
 	as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL);
 	if (!as) {
 		_leave(" = -ENOMEM");
-		unlock_kernel();
 		return -ENOMEM;
 	}
 
@@ -344,7 +340,6 @@ static int afs_fill_super(struct super_block *sb, void *data)
 	sb->s_root = root;
 
 	_leave(" = 0");
-	unlock_kernel();
 	return 0;
 
 error_inode:
@@ -358,7 +353,6 @@ error:
 	sb->s_fs_info = NULL;
 
 	_leave(" = %d", ret);
-	unlock_kernel();
 	return ret;
 }
 
@@ -458,12 +452,8 @@ static void afs_put_super(struct super_block *sb)
 
 	_enter("");
 
-	lock_kernel();
-
 	afs_put_volume(as->volume);
 
-	unlock_kernel();
-
 	_leave("");
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 09/12] BKL: Remove BKL from ecryptfs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (7 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 08/12] BKL: Remove BKL from afs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 10/12] BKL: Remove BKL from jffs2 Arnd Bergmann
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Dustin Kirkland, Tyler Hicks, ecryptfs-devel

The BKL is only used in fill_super, which is protected by the superblocks
s_umount rw_semaphorei, and in fasync, which does not do anything that
could require the BKL. Therefore it is safe to remove the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Dustin Kirkland <kirkland@canonical.com>
Cc: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: ecryptfs-devel@lists.launchpad.net
---
 fs/ecryptfs/file.c |    3 ---
 fs/ecryptfs/main.c |    4 ----
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 622c951..2b9a644 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -31,7 +31,6 @@
 #include <linux/security.h>
 #include <linux/compat.h>
 #include <linux/fs_stack.h>
-#include <linux/smp_lock.h>
 #include "ecryptfs_kernel.h"
 
 /**
@@ -284,11 +283,9 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
 	int rc = 0;
 	struct file *lower_file = NULL;
 
-	lock_kernel();
 	lower_file = ecryptfs_file_to_lower(file);
 	if (lower_file->f_op && lower_file->f_op->fasync)
 		rc = lower_file->f_op->fasync(fd, lower_file, flag);
-	unlock_kernel();
 	return rc;
 }
 
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index c4af92f..cbd4e18 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -36,7 +36,6 @@
 #include <linux/parser.h>
 #include <linux/fs_stack.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>     /* For lock_kernel() */
 #include "ecryptfs_kernel.h"
 
 /**
@@ -551,7 +550,6 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
 	const char *err = "Getting sb failed";
 	int rc;
 
-	lock_kernel();
 	sbi = kmem_cache_zalloc(ecryptfs_sb_info_cache, GFP_KERNEL);
 	if (!sbi) {
 		rc = -ENOMEM;
@@ -610,7 +608,6 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
 		goto out;
 	}
 	simple_set_mnt(mnt, s);
-	unlock_kernel();
 	return 0;
 
 out:
@@ -619,7 +616,6 @@ out:
 		kmem_cache_free(ecryptfs_sb_info_cache, sbi);
 	}
 	printk(KERN_ERR "%s; rc = [%d]\n", err, rc);
-	unlock_kernel();
 	return rc;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 10/12] BKL: Remove BKL from jffs2
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (8 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 09/12] BKL: Remove BKL from ecryptfs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 11/12] BKL: Remove BKL from squashfs Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 12/12] BKL: Remove BKL from OCFS2 Arnd Bergmann
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, David Woodhouse

The BKL is only used in put_super, fill_super and remount_fs that are all
three protected by the superblocks s_umount rw_semaphore. Therefore it is
safe to remove the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 fs/jffs2/fs.c    |    4 ----
 fs/jffs2/super.c |   12 +-----------
 2 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 6b2964a..d9beb06 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -21,7 +21,6 @@
 #include <linux/vmalloc.h>
 #include <linux/vfs.h>
 #include <linux/crc32.h>
-#include <linux/smp_lock.h>
 #include "nodelist.h"
 
 static int jffs2_flash_setup(struct jffs2_sb_info *c);
@@ -391,7 +390,6 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
 	   This also catches the case where it was stopped and this
 	   is just a remount to restart it.
 	   Flush the writebuffer, if neccecary, else we loose it */
-	lock_kernel();
 	if (!(sb->s_flags & MS_RDONLY)) {
 		jffs2_stop_garbage_collect_thread(c);
 		mutex_lock(&c->alloc_sem);
@@ -403,8 +401,6 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
 		jffs2_start_garbage_collect_thread(c);
 
 	*flags |= MS_NOATIME;
-
-	unlock_kernel();
 	return 0;
 }
 
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 58dd9cf..d1ae5df 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/fs.h>
@@ -148,17 +147,13 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
 	struct jffs2_sb_info *c;
 	int ret;
 
-	lock_kernel();
-
 	D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():"
 		  " New superblock for device %d (\"%s\")\n",
 		  sb->s_mtd->index, sb->s_mtd->name));
 
 	c = kzalloc(sizeof(*c), GFP_KERNEL);
-	if (!c) {
-		unlock_kernel();
+	if (!c)
 		return -ENOMEM;
-	}
 
 	c->mtd = sb->s_mtd;
 	c->os_priv = sb;
@@ -181,7 +176,6 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_flags |= MS_POSIXACL;
 #endif
 	ret = jffs2_do_fill_super(sb, data, silent);
-	unlock_kernel();
 	return ret;
 }
 
@@ -199,8 +193,6 @@ static void jffs2_put_super (struct super_block *sb)
 
 	D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n"));
 
-	lock_kernel();
-
 	if (sb->s_dirt)
 		jffs2_write_super(sb);
 
@@ -222,8 +214,6 @@ static void jffs2_put_super (struct super_block *sb)
 	if (c->mtd->sync)
 		c->mtd->sync(c->mtd);
 
-	unlock_kernel();
-
 	D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 11/12] BKL: Remove BKL from squashfs
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (9 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 10/12] BKL: Remove BKL from jffs2 Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 17:46 ` [PATCH 12/12] BKL: Remove BKL from OCFS2 Arnd Bergmann
  11 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Phillip Lougher

The BKL is only used in put_super and fill_super, which are both protected
by the superblocks s_umount rw_semaphore. Therefore it is safe to remove
the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
---
 fs/squashfs/super.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index ab1a401..07a4f11 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -30,7 +30,6 @@
 #include <linux/fs.h>
 #include <linux/vfs.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/mutex.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
@@ -87,14 +86,11 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
 	u64 lookup_table_start, xattr_id_table_start;
 	int err;
 
-	lock_kernel();
-
 	TRACE("Entered squashfs_fill_superblock\n");
 
 	sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
 	if (sb->s_fs_info == NULL) {
 		ERROR("Failed to allocate squashfs_sb_info\n");
-		unlock_kernel();
 		return -ENOMEM;
 	}
 	msblk = sb->s_fs_info;
@@ -304,7 +300,6 @@ allocate_root:
 
 	TRACE("Leaving squashfs_fill_super\n");
 	kfree(sblk);
-	unlock_kernel();
 	return 0;
 
 failed_mount:
@@ -319,13 +314,11 @@ failed_mount:
 	kfree(sb->s_fs_info);
 	sb->s_fs_info = NULL;
 	kfree(sblk);
-	unlock_kernel();
 	return err;
 
 failure:
 	kfree(sb->s_fs_info);
 	sb->s_fs_info = NULL;
-	unlock_kernel();
 	return -ENOMEM;
 }
 
@@ -360,8 +353,6 @@ static int squashfs_remount(struct super_block *sb, int *flags, char *data)
 
 static void squashfs_put_super(struct super_block *sb)
 {
-	lock_kernel();
-
 	if (sb->s_fs_info) {
 		struct squashfs_sb_info *sbi = sb->s_fs_info;
 		squashfs_cache_delete(sbi->block_cache);
@@ -376,8 +367,6 @@ static void squashfs_put_super(struct super_block *sb)
 		kfree(sb->s_fs_info);
 		sb->s_fs_info = NULL;
 	}
-
-	unlock_kernel();
 }
 
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 12/12] BKL: Remove BKL from OCFS2
  2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
                   ` (10 preceding siblings ...)
  2010-09-16 17:46 ` [PATCH 11/12] BKL: Remove BKL from squashfs Arnd Bergmann
@ 2010-09-16 17:46 ` Arnd Bergmann
  2010-09-16 22:26   ` Mark Fasheh
  11 siblings, 1 reply; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Mark Fasheh, Joel Becker

The BKL in ocfs2/dlmfs is used in put_super, fill_super and remount_fs
that are all three protected by the superblocks s_umount rw_semaphore.

The use in ocfs2_control_open is evidently unrelated and the function
is protected by ocfs2_control_lock.

Therefore it is safe to remove the BKL entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
---
 fs/ocfs2/dlmfs/dlmfs.c |    9 +--------
 fs/ocfs2/stack_user.c  |    3 ---
 fs/ocfs2/super.c       |   12 ------------
 3 files changed, 1 insertions(+), 23 deletions(-)

diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 667d7ce..c2903b8 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -44,7 +44,6 @@
 #include <linux/string.h>
 #include <linux/backing-dev.h>
 #include <linux/poll.h>
-#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 
@@ -589,27 +588,21 @@ static int dlmfs_fill_super(struct super_block * sb,
 	struct inode * inode;
 	struct dentry * root;
 
-	lock_kernel();
-
 	sb->s_maxbytes = MAX_LFS_FILESIZE;
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	sb->s_magic = DLMFS_MAGIC;
 	sb->s_op = &dlmfs_ops;
 	inode = dlmfs_get_root_inode(sb);
-	if (!inode) {
-		unlock_kernel();
+	if (!inode)
 		return -ENOMEM;
-	}
 
 	root = d_alloc_root(inode);
 	if (!root) {
 		iput(inode);
-		unlock_kernel();
 		return -ENOMEM;
 	}
 	sb->s_root = root;
-	unlock_kernel();
 	return 0;
 }
 
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 2dc57bc..0e68f54 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -22,7 +22,6 @@
 #include <linux/miscdevice.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/reboot.h>
 #include <asm/uaccess.h>
 
@@ -612,12 +611,10 @@ static int ocfs2_control_open(struct inode *inode, struct file *file)
 		return -ENOMEM;
 	p->op_this_node = -1;
 
-	lock_kernel();
 	mutex_lock(&ocfs2_control_lock);
 	file->private_data = p;
 	list_add(&p->op_list, &ocfs2_control_private_list);
 	mutex_unlock(&ocfs2_control_lock);
-	unlock_kernel();
 
 	return 0;
 }
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index b7e4f2d..b7d7243 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -609,8 +609,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
 	struct mount_options parsed_options;
 	struct ocfs2_super *osb = OCFS2_SB(sb);
 
-	lock_kernel();
-
 	if (!ocfs2_parse_options(sb, data, &parsed_options, 1) ||
 	    !ocfs2_check_set_options(sb, &parsed_options)) {
 		ret = -EINVAL;
@@ -717,7 +715,6 @@ unlock_osb:
 							MS_POSIXACL : 0);
 	}
 out:
-	unlock_kernel();
 	return ret;
 }
 
@@ -1002,8 +999,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 	char nodestr[8];
 	struct ocfs2_blockcheck_stats stats;
 
-	lock_kernel();
-
 	mlog_entry("%p, %p, %i", sb, data, silent);
 
 	if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) {
@@ -1181,7 +1176,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 			atomic_set(&osb->vol_state, VOLUME_DISABLED);
 			wake_up(&osb->osb_mount_event);
 			mlog_exit(status);
-			unlock_kernel();
 			return status;
 		}
 	}
@@ -1196,7 +1190,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 	ocfs2_orphan_scan_start(osb);
 
 	mlog_exit(status);
-	unlock_kernel();
 	return status;
 
 read_super_error:
@@ -1212,7 +1205,6 @@ read_super_error:
 	}
 
 	mlog_exit(status);
-	unlock_kernel();
 	return status;
 }
 
@@ -1645,13 +1637,9 @@ static void ocfs2_put_super(struct super_block *sb)
 {
 	mlog_entry("(0x%p)\n", sb);
 
-	lock_kernel();
-
 	ocfs2_sync_blockdev(sb);
 	ocfs2_dismount_volume(sb, 0);
 
-	unlock_kernel();
-
 	mlog_exit_void();
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 17:46 ` [PATCH 04/12] BKL: Remove BKL from autofs4 Arnd Bergmann
@ 2010-09-16 17:49   ` H. Peter Anvin
  2010-09-16 17:55     ` Arnd Bergmann
  0 siblings, 1 reply; 24+ messages in thread
From: H. Peter Anvin @ 2010-09-16 17:49 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel

On 09/16/2010 10:46 AM, Arnd Bergmann wrote:
> autofs4 uses the BKL only to guard its ioctl operations.
> This can be trivially converted to use a mutex, as we have
> done with most device drivers before.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> ---
>  fs/autofs4/root.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)

You may want to Cc: the maintainer, Ian Kent.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 17:49   ` H. Peter Anvin
@ 2010-09-16 17:55     ` Arnd Bergmann
  2010-09-16 19:20       ` H. Peter Anvin
  2010-09-17  1:33       ` Ian Kent
  0 siblings, 2 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-16 17:55 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel, Ian Kent, autofs

On Thursday 16 September 2010 19:49:53 H. Peter Anvin wrote:
> On 09/16/2010 10:46 AM, Arnd Bergmann wrote:
> > autofs4 uses the BKL only to guard its ioctl operations.
> > This can be trivially converted to use a mutex, as we have
> > done with most device drivers before.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > ---
> >  fs/autofs4/root.c |   12 +++++++-----
> >  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> You may want to Cc: the maintainer, Ian Kent.

Ah, sorry about this. I looked at the wrong MAINTAINERS entry.

I also forgot to Cc you about autofs3, adding more to the confusion. ;)

Do you think the time has come to move autofs3 to drivers/staging
as we deprecate the BKL?

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 01/12] BKL: Remove BKL from usbfs
  2010-09-16 17:46 ` [PATCH 01/12] BKL: Remove BKL from usbfs Arnd Bergmann
@ 2010-09-16 18:47   ` Greg KH
  0 siblings, 0 replies; 24+ messages in thread
From: Greg KH @ 2010-09-16 18:47 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, Jan Blunck

On Thu, Sep 16, 2010 at 07:46:14PM +0200, Arnd Bergmann wrote:
> Nothing in there has a race that can be
> prevented by holding the BKL.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: Jan Blunck <jblunck@infradead.org>

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 17:55     ` Arnd Bergmann
@ 2010-09-16 19:20       ` H. Peter Anvin
  2010-09-17  1:31         ` Ian Kent
  2010-09-17  1:33       ` Ian Kent
  1 sibling, 1 reply; 24+ messages in thread
From: H. Peter Anvin @ 2010-09-16 19:20 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, Ian Kent, autofs

On 09/16/2010 10:55 AM, Arnd Bergmann wrote:
> On Thursday 16 September 2010 19:49:53 H. Peter Anvin wrote:
>> On 09/16/2010 10:46 AM, Arnd Bergmann wrote:
>>> autofs4 uses the BKL only to guard its ioctl operations.
>>> This can be trivially converted to use a mutex, as we have
>>> done with most device drivers before.
>>>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>>> ---
>>>  fs/autofs4/root.c |   12 +++++++-----
>>>  1 files changed, 7 insertions(+), 5 deletions(-)
>>
>> You may want to Cc: the maintainer, Ian Kent.
> 
> Ah, sorry about this. I looked at the wrong MAINTAINERS entry.
> 
> I also forgot to Cc you about autofs3, adding more to the confusion. ;)
> 
> Do you think the time has come to move autofs3 to drivers/staging
> as we deprecate the BKL?
> 

I'm leaving that up to Ian.  I have offered for years to just plain kill
off autofs3.

	-hpa

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 12/12] BKL: Remove BKL from OCFS2
  2010-09-16 17:46 ` [PATCH 12/12] BKL: Remove BKL from OCFS2 Arnd Bergmann
@ 2010-09-16 22:26   ` Mark Fasheh
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Fasheh @ 2010-09-16 22:26 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, Joel Becker

On Thu, Sep 16, 2010 at 07:46:25PM +0200, Arnd Bergmann wrote:
> The BKL in ocfs2/dlmfs is used in put_super, fill_super and remount_fs
> that are all three protected by the superblocks s_umount rw_semaphore.

Those look good, thanks.


> The use in ocfs2_control_open is evidently unrelated and the function
> is protected by ocfs2_control_lock.

<snip>

> @@ -612,12 +611,10 @@ static int ocfs2_control_open(struct inode *inode, struct file *file)
>  		return -ENOMEM;
>  	p->op_this_node = -1;
>  
> -	lock_kernel();
>  	mutex_lock(&ocfs2_control_lock);
>  	file->private_data = p;
>  	list_add(&p->op_list, &ocfs2_control_private_list);
>  	mutex_unlock(&ocfs2_control_lock);
> -	unlock_kernel();
>  
>  	return 0;
>  }

My guess is that this one is good to go too. Joel?
	--Mark

--
Mark Fasheh

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 19:20       ` H. Peter Anvin
@ 2010-09-17  1:31         ` Ian Kent
  0 siblings, 0 replies; 24+ messages in thread
From: Ian Kent @ 2010-09-17  1:31 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Arnd Bergmann, linux-kernel, autofs

On Thu, 2010-09-16 at 12:20 -0700, H. Peter Anvin wrote:
> On 09/16/2010 10:55 AM, Arnd Bergmann wrote:
> > On Thursday 16 September 2010 19:49:53 H. Peter Anvin wrote:
> >> On 09/16/2010 10:46 AM, Arnd Bergmann wrote:
> >>> autofs4 uses the BKL only to guard its ioctl operations.
> >>> This can be trivially converted to use a mutex, as we have
> >>> done with most device drivers before.
> >>>
> >>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >>> Cc: "H. Peter Anvin" <hpa@zytor.com>
> >>> ---
> >>>  fs/autofs4/root.c |   12 +++++++-----
> >>>  1 files changed, 7 insertions(+), 5 deletions(-)
> >>
> >> You may want to Cc: the maintainer, Ian Kent.
> > 
> > Ah, sorry about this. I looked at the wrong MAINTAINERS entry.
> > 
> > I also forgot to Cc you about autofs3, adding more to the confusion. ;)
> > 
> > Do you think the time has come to move autofs3 to drivers/staging
> > as we deprecate the BKL?
> > 
> 
> I'm leaving that up to Ian.  I have offered for years to just plain kill
> off autofs3.

Yeah, my bad, again.
Now I want to wait for David Howells VFS automount series, which we're
working on now, since that will be a significant change.

> 
> 	-hpa



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-16 17:55     ` Arnd Bergmann
  2010-09-16 19:20       ` H. Peter Anvin
@ 2010-09-17  1:33       ` Ian Kent
  2010-09-17  7:17         ` Arnd Bergmann
  1 sibling, 1 reply; 24+ messages in thread
From: Ian Kent @ 2010-09-17  1:33 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: H. Peter Anvin, linux-kernel, autofs

On Thu, 2010-09-16 at 19:55 +0200, Arnd Bergmann wrote:
> On Thursday 16 September 2010 19:49:53 H. Peter Anvin wrote:
> > On 09/16/2010 10:46 AM, Arnd Bergmann wrote:
> > > autofs4 uses the BKL only to guard its ioctl operations.
> > > This can be trivially converted to use a mutex, as we have
> > > done with most device drivers before.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > > ---
> > >  fs/autofs4/root.c |   12 +++++++-----
> > >  1 files changed, 7 insertions(+), 5 deletions(-)
> > 
> > You may want to Cc: the maintainer, Ian Kent.
> 
> Ah, sorry about this. I looked at the wrong MAINTAINERS entry.
> 
> I also forgot to Cc you about autofs3, adding more to the confusion. ;)
> 
> Do you think the time has come to move autofs3 to drivers/staging
> as we deprecate the BKL?

Umm ... what's this process, the drivers/staging?

> 
> 	Arnd



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-17  1:33       ` Ian Kent
@ 2010-09-17  7:17         ` Arnd Bergmann
  2010-09-17 17:01           ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-17  7:17 UTC (permalink / raw)
  To: Ian Kent; +Cc: H. Peter Anvin, linux-kernel, autofs, Greg KH

On Friday 17 September 2010 03:33:11 Ian Kent wrote:
> On Thu, 2010-09-16 at 19:55 +0200, Arnd Bergmann wrote:
> > Ah, sorry about this. I looked at the wrong MAINTAINERS entry.
> > 
> > I also forgot to Cc you about autofs3, adding more to the confusion. ;)
> > 
> > Do you think the time has come to move autofs3 to drivers/staging
> > as we deprecate the BKL?
> 
> Umm ... what's this process, the drivers/staging?

We use drivers/staging now both for getting code into the kernel
and for getting it out of there. Moving autofs3 to drivers/staging/autofs/
would serve as a last warning to everyone using it, but users could
still use it while it's there. If anyone is interested, they can submit
fixes (BKL removal and whatever else is needed) to get it back into
the mainline. If it doesn't happen, Greg would finally remove it two
kernel releases later.

My hope is that we can move all modules that still use the BKL after
2.6.37 to drivers/staging, unless we have someone already working
on the patches.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/12] BKL: Remove BKL from autofs4
  2010-09-17  7:17         ` Arnd Bergmann
@ 2010-09-17 17:01           ` Greg KH
  0 siblings, 0 replies; 24+ messages in thread
From: Greg KH @ 2010-09-17 17:01 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Ian Kent, H. Peter Anvin, linux-kernel, autofs

On Fri, Sep 17, 2010 at 09:17:29AM +0200, Arnd Bergmann wrote:
> On Friday 17 September 2010 03:33:11 Ian Kent wrote:
> > On Thu, 2010-09-16 at 19:55 +0200, Arnd Bergmann wrote:
> > > Ah, sorry about this. I looked at the wrong MAINTAINERS entry.
> > > 
> > > I also forgot to Cc you about autofs3, adding more to the confusion. ;)
> > > 
> > > Do you think the time has come to move autofs3 to drivers/staging
> > > as we deprecate the BKL?
> > 
> > Umm ... what's this process, the drivers/staging?
> 
> We use drivers/staging now both for getting code into the kernel
> and for getting it out of there. Moving autofs3 to drivers/staging/autofs/
> would serve as a last warning to everyone using it, but users could
> still use it while it's there. If anyone is interested, they can submit
> fixes (BKL removal and whatever else is needed) to get it back into
> the mainline. If it doesn't happen, Greg would finally remove it two
> kernel releases later.
> 
> My hope is that we can move all modules that still use the BKL after
> 2.6.37 to drivers/staging, unless we have someone already working
> on the patches.

That sounds fine with me, send me patches whenever you want to and I
will gladly take them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 06/12] BKL: Remove BKL from capifs
  2010-09-16 17:46 ` [PATCH 06/12] BKL: Remove BKL from capifs Arnd Bergmann
@ 2010-09-17 23:35   ` David Miller
  2010-09-18  7:55     ` Arnd Bergmann
  0 siblings, 1 reply; 24+ messages in thread
From: David Miller @ 2010-09-17 23:35 UTC (permalink / raw)
  To: arnd; +Cc: linux-kernel, netdev

From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 16 Sep 2010 19:46:19 +0200

> The BKL is only used in fill_super, which is  protected by the superblocks
> s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: netdev@vger.kernel.org

I've searched Linus's tree, net-2.6, and net-next-2.6 and I cannot
find one reference to lock_kernel() in drivers/isdn/capi/capifs.c
in any of them.

What did you write this patch against?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 06/12] BKL: Remove BKL from capifs
  2010-09-17 23:35   ` David Miller
@ 2010-09-18  7:55     ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2010-09-18  7:55 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, netdev

On Saturday 18 September 2010 01:35:30 David Miller wrote:
> 
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Thu, 16 Sep 2010 19:46:19 +0200
> 
> > The BKL is only used in fill_super, which is  protected by the superblocks
> > s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Cc: netdev@vger.kernel.org
> 
> I've searched Linus's tree, net-2.6, and net-next-2.6 and I cannot
> find one reference to lock_kernel() in drivers/isdn/capi/capifs.c
> in any of them.
> 
> What did you write this patch against?

As I wrote in my [PATCH 0/12], it applies on top of the pushdown
of the BKL into the get_sb operation, and I intend to submit it
to Linus with the full series.

I agree that this particular patch is a bit pointless because
all it does is to undo the change from the pushdown. I guess
that at the time when the first patch was written, the BKL
was still present in other parts of capifs.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2010-09-18  7:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-16 17:46 [PATCH 00/12] more BKL removal after get_sb pushdown Arnd Bergmann
2010-09-16 17:46 ` [PATCH 01/12] BKL: Remove BKL from usbfs Arnd Bergmann
2010-09-16 18:47   ` Greg KH
2010-09-16 17:46 ` [PATCH 02/12] BKL: Remove BKL from fat Arnd Bergmann
2010-09-16 17:46 ` [PATCH 03/12] BKL: Remove BKL from isofs Arnd Bergmann
2010-09-16 17:46 ` [PATCH 04/12] BKL: Remove BKL from autofs4 Arnd Bergmann
2010-09-16 17:49   ` H. Peter Anvin
2010-09-16 17:55     ` Arnd Bergmann
2010-09-16 19:20       ` H. Peter Anvin
2010-09-17  1:31         ` Ian Kent
2010-09-17  1:33       ` Ian Kent
2010-09-17  7:17         ` Arnd Bergmann
2010-09-17 17:01           ` Greg KH
2010-09-16 17:46 ` [PATCH 05/12] BKL: Remove BKL from ReiserFS Arnd Bergmann
2010-09-16 17:46 ` [PATCH 06/12] BKL: Remove BKL from capifs Arnd Bergmann
2010-09-17 23:35   ` David Miller
2010-09-18  7:55     ` Arnd Bergmann
2010-09-16 17:46 ` [PATCH 07/12] BKL: Remove BKL from USB gadgetfs Arnd Bergmann
2010-09-16 17:46 ` [PATCH 08/12] BKL: Remove BKL from afs Arnd Bergmann
2010-09-16 17:46 ` [PATCH 09/12] BKL: Remove BKL from ecryptfs Arnd Bergmann
2010-09-16 17:46 ` [PATCH 10/12] BKL: Remove BKL from jffs2 Arnd Bergmann
2010-09-16 17:46 ` [PATCH 11/12] BKL: Remove BKL from squashfs Arnd Bergmann
2010-09-16 17:46 ` [PATCH 12/12] BKL: Remove BKL from OCFS2 Arnd Bergmann
2010-09-16 22:26   ` Mark Fasheh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.