Whamcloud - gitweb
LU-506 kernel: remove BKL fix
authorLai Siyao <laisiyao@whamcloud.com>
Tue, 21 Feb 2012 07:40:55 +0000 (15:40 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 29 May 2012 05:00:56 +0000 (01:00 -0400)
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 <laisiyao@whamcloud.com>
Change-Id: I5c93252dc02e0ff90ce108701f9d847e4ee2e4e6
Reviewed-on: http://review.whamcloud.com/2928
Tested-by: Hudson
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obd_mount.c

index fc23461..4efae3c 100644 (file)
@@ -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);