Skip to content

Commit 6005679

Browse files
committed
BKL: Remove BKL from OCFS2
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>
1 parent 3dbc4b3 commit 6005679

3 files changed

Lines changed: 1 addition & 23 deletions

File tree

‎fs/ocfs2/dlmfs/dlmfs.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include <linux/string.h>
4545
#include <linux/backing-dev.h>
4646
#include <linux/poll.h>
47-
#include <linux/smp_lock.h>
4847

4948
#include <asm/uaccess.h>
5049

@@ -589,27 +588,21 @@ static int dlmfs_fill_super(struct super_block * sb,
589588
struct inode * inode;
590589
struct dentry * root;
591590

592-
lock_kernel();
593-
594591
sb->s_maxbytes = MAX_LFS_FILESIZE;
595592
sb->s_blocksize = PAGE_CACHE_SIZE;
596593
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
597594
sb->s_magic = DLMFS_MAGIC;
598595
sb->s_op = &dlmfs_ops;
599596
inode = dlmfs_get_root_inode(sb);
600-
if (!inode) {
601-
unlock_kernel();
597+
if (!inode)
602598
return -ENOMEM;
603-
}
604599

605600
root = d_alloc_root(inode);
606601
if (!root) {
607602
iput(inode);
608-
unlock_kernel();
609603
return -ENOMEM;
610604
}
611605
sb->s_root = root;
612-
unlock_kernel();
613606
return 0;
614607
}
615608

‎fs/ocfs2/stack_user.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <linux/miscdevice.h>
2323
#include <linux/mutex.h>
2424
#include <linux/slab.h>
25-
#include <linux/smp_lock.h>
2625
#include <linux/reboot.h>
2726
#include <asm/uaccess.h>
2827

@@ -612,12 +611,10 @@ static int ocfs2_control_open(struct inode *inode, struct file *file)
612611
return -ENOMEM;
613612
p->op_this_node = -1;
614613

615-
lock_kernel();
616614
mutex_lock(&ocfs2_control_lock);
617615
file->private_data = p;
618616
list_add(&p->op_list, &ocfs2_control_private_list);
619617
mutex_unlock(&ocfs2_control_lock);
620-
unlock_kernel();
621618

622619
return 0;
623620
}

‎fs/ocfs2/super.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
609609
struct mount_options parsed_options;
610610
struct ocfs2_super *osb = OCFS2_SB(sb);
611611

612-
lock_kernel();
613-
614612
if (!ocfs2_parse_options(sb, data, &parsed_options, 1) ||
615613
!ocfs2_check_set_options(sb, &parsed_options)) {
616614
ret = -EINVAL;
@@ -717,7 +715,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
717715
MS_POSIXACL : 0);
718716
}
719717
out:
720-
unlock_kernel();
721718
return ret;
722719
}
723720

@@ -1002,8 +999,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
1002999
char nodestr[8];
10031000
struct ocfs2_blockcheck_stats stats;
10041001

1005-
lock_kernel();
1006-
10071002
mlog_entry("%p, %p, %i", sb, data, silent);
10081003

10091004
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)
11811176
atomic_set(&osb->vol_state, VOLUME_DISABLED);
11821177
wake_up(&osb->osb_mount_event);
11831178
mlog_exit(status);
1184-
unlock_kernel();
11851179
return status;
11861180
}
11871181
}
@@ -1196,7 +1190,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
11961190
ocfs2_orphan_scan_start(osb);
11971191

11981192
mlog_exit(status);
1199-
unlock_kernel();
12001193
return status;
12011194

12021195
read_super_error:
@@ -1212,7 +1205,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
12121205
}
12131206

12141207
mlog_exit(status);
1215-
unlock_kernel();
12161208
return status;
12171209
}
12181210

@@ -1645,13 +1637,9 @@ static void ocfs2_put_super(struct super_block *sb)
16451637
{
16461638
mlog_entry("(0x%p)\n", sb);
16471639

1648-
lock_kernel();
1649-
16501640
ocfs2_sync_blockdev(sb);
16511641
ocfs2_dismount_volume(sb, 0);
16521642

1653-
unlock_kernel();
1654-
16551643
mlog_exit_void();
16561644
}
16571645

0 commit comments

Comments
 (0)