[PATCH 08/27] BKL: Remove BKL from ext4 filesystem

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown [PATCH 08/27] BKL: Remove BKL from ext4 filesystem

by Jan Blunck-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The BKL is still used in ext4_put_super(), ext4_fill_super() and
ext4_remount(). All three calles are protected against concurrent calls by
the s_umount rw semaphore of struct super_block.

Therefore the BKL is protecting nothing in this case.

Signed-off-by: Jan Blunck <jblunck@...>
---
 fs/ext4/super.c |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9db81d2..328e9dc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -26,7 +26,6 @@
 #include <linux/init.h>
 #include <linux/blkdev.h>
 #include <linux/parser.h>
-#include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 #include <linux/exportfs.h>
 #include <linux/vfs.h>
@@ -599,7 +598,6 @@ static void ext4_put_super(struct super_block *sb)
  destroy_workqueue(sbi->dio_unwritten_wq);
 
  lock_super(sb);
- lock_kernel();
  if (sb->s_dirt)
  ext4_commit_super(sb, 1);
 
@@ -665,7 +663,6 @@ static void ext4_put_super(struct super_block *sb)
  * Now that we are completely done shutting down the
  * superblock, we need to actually destroy the kobject.
  */
- unlock_kernel();
  unlock_super(sb);
  kobject_put(&sbi->s_kobj);
  wait_for_completion(&sbi->s_kobj_unregister);
@@ -2328,19 +2325,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
  int err;
  unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
 
- lock_kernel();
-
  sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
- if (!sbi) {
- unlock_kernel();
+ if (!sbi)
  return -ENOMEM;
- }
 
  sbi->s_blockgroup_lock =
  kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
  if (!sbi->s_blockgroup_lock) {
  kfree(sbi);
- unlock_kernel();
  return -ENOMEM;
  }
  sb->s_fs_info = sbi;
@@ -2352,8 +2344,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
  sbi->s_sectors_written_start = part_stat_read(sb->s_bdev->bd_part,
       sectors[1]);
 
- unlock_kernel();
-
  /* Cleanup superblock name */
  for (cp = sb->s_id; (cp = strchr(cp, '/'));)
  *cp = '!';
@@ -3456,8 +3446,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
  int i;
 #endif
 
- lock_kernel();
-
  /* Store the original options */
  lock_super(sb);
  old_sb_flags = sb->s_flags;
@@ -3587,7 +3575,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
  kfree(old_opts.s_qf_names[i]);
 #endif
  unlock_super(sb);
- unlock_kernel();
  return 0;
 
 restore_opts:
@@ -3608,7 +3595,6 @@ restore_opts:
  }
 #endif
  unlock_super(sb);
- unlock_kernel();
  return err;
 }
 
--
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 08/27] BKL: Remove BKL from ext4 filesystem

by tytso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 02, 2009 at 11:04:48AM +0100, Jan Blunck wrote:
> The BKL is still used in ext4_put_super(), ext4_fill_super() and
> ext4_remount(). All three calles are protected against concurrent calls by
> the s_umount rw semaphore of struct super_block.
>
> Therefore the BKL is protecting nothing in this case.
>
> Signed-off-by: Jan Blunck <jblunck@...>

Acked-by: "Theodore Ts'o" <tytso@...>

                                                - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html