Skip to content

Commit 18dfe89

Browse files
committed
BKL: Remove BKL from ecryptfs
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
1 parent 77f2fe0 commit 18dfe89

2 files changed

Lines changed: 0 additions & 7 deletions

File tree

‎fs/ecryptfs/file.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <linux/security.h>
3232
#include <linux/compat.h>
3333
#include <linux/fs_stack.h>
34-
#include <linux/smp_lock.h>
3534
#include "ecryptfs_kernel.h"
3635

3736
/**
@@ -284,11 +283,9 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
284283
int rc = 0;
285284
struct file *lower_file = NULL;
286285

287-
lock_kernel();
288286
lower_file = ecryptfs_file_to_lower(file);
289287
if (lower_file->f_op && lower_file->f_op->fasync)
290288
rc = lower_file->f_op->fasync(fd, lower_file, flag);
291-
unlock_kernel();
292289
return rc;
293290
}
294291

‎fs/ecryptfs/main.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include <linux/parser.h>
3737
#include <linux/fs_stack.h>
3838
#include <linux/slab.h>
39-
#include <linux/smp_lock.h> /* For lock_kernel() */
4039
#include "ecryptfs_kernel.h"
4140

4241
/**
@@ -551,7 +550,6 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
551550
const char *err = "Getting sb failed";
552551
int rc;
553552

554-
lock_kernel();
555553
sbi = kmem_cache_zalloc(ecryptfs_sb_info_cache, GFP_KERNEL);
556554
if (!sbi) {
557555
rc = -ENOMEM;
@@ -610,7 +608,6 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
610608
goto out;
611609
}
612610
simple_set_mnt(mnt, s);
613-
unlock_kernel();
614611
return 0;
615612

616613
out:
@@ -619,7 +616,6 @@ static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
619616
kmem_cache_free(ecryptfs_sb_info_cache, sbi);
620617
}
621618
printk(KERN_ERR "%s; rc = [%d]\n", err, rc);
622-
unlock_kernel();
623619
return rc;
624620
}
625621

0 commit comments

Comments
 (0)