From: Lai Siyao Date: Tue, 21 Feb 2012 07:40:55 +0000 (+0800) Subject: LU-506 kernel: remove BKL fix X-Git-Tag: 2.2.54~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=00ff8890b3378e45ef3517f518673f7446d79264 LU-506 kernel: remove BKL fix Commit I8a3432ad56b7a1fcdbf74be4b7819edb31bf6272 has defect; it's fixed in this patch: * use #ifdef instead of #if for HAVE_KERNEL_LOCKED check. * in case of HAVE_KERNEL_LOCKED, a mntput() is missed if kernel is not locked. Signed-off-by: Lai Siyao Change-Id: I5c93252dc02e0ff90ce108701f9d847e4ee2e4e6 Reviewed-on: http://review.whamcloud.com/2928 Tested-by: Hudson Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index fc23461..4efae3c 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -198,12 +198,14 @@ struct lustre_mount_info *server_get_mount_2(const char *name) static void unlock_mntput(struct vfsmount *mnt) { -#if HAVE_KERNEL_LOCKED +#ifdef HAVE_KERNEL_LOCKED /* for kernel < 2.6.37 */ if (kernel_locked()) { unlock_kernel(); mntput(mnt); lock_kernel(); + } else { + mntput(mnt); } #else mntput(mnt);