Whamcloud - gitweb
LU-6446 ldiskfs: remove WARN_ON from ldiskfs_orphan_add{del} 90/14690/4
authorYang Sheng <yang.sheng@intel.com>
Wed, 6 May 2015 03:56:05 +0000 (11:56 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 27 Jul 2015 19:03:54 +0000 (19:03 +0000)
RHEL7.1 kernel carefully check i_mutex whether locked in
many places. It will be triggered while ldiskfs_truncate()
was invoked in osd layer. A dead lock would occured if we
just locked i_mutex around it since Lustre using a reverse
order for start journal==>lock i_mutex. Consider Lustre has
own ldlm lock. So just remove such messages in ldiskfs patches.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: I79520b0a1d013722a5a27e71318416608bc25285
Reviewed-on: http://review.whamcloud.com/14690
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel7/ext4-remove-truncate-warning.patch

index 999d86a..6bfb54e 100644 (file)
@@ -2,11 +2,11 @@ There will cause a deadlock if invoke ext4_truncate with i_mutex locked
 in lustre. Since lustre has own lock to provide protect so we don't
 need this check at all. 
 
-Index: linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/inode.c
+Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/inode.c
 ===================================================================
---- linux-3.10.0-123.13.2.el7.x86_64.orig/fs/ext4/inode.c
-+++ linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/inode.c
-@@ -3847,8 +3847,6 @@ void ext4_truncate(struct inode *inode)
+--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/inode.c
++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/inode.c
+@@ -3644,8 +3644,6 @@ void ext4_truncate(struct inode *inode)
         * or it completely new indode. In those cases we might not
         * have i_mutex locked because it's not necessary.
         */
@@ -15,3 +15,25 @@ Index: linux-3.10.0-123.13.2.el7.x86_64/fs/ext4/inode.c
        trace_ext4_truncate_enter(inode);
  
        if (!ext4_can_truncate(inode))
+Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/namei.c
+===================================================================
+--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/namei.c
++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/namei.c
+@@ -3163,8 +3163,6 @@ int ext4_orphan_add(handle_t *handle, st
+       if (!sbi->s_journal || is_bad_inode(inode))
+               return 0;
+-      WARN_ON_ONCE(!(inode->i_state & (I_NEW | I_FREEING)) &&
+-                   !mutex_is_locked(&inode->i_mutex));
+       /*
+        * Exit early if inode already is on orphan list. This is a big speedup
+        * since we don't have to contend on the global s_orphan_lock.
+@@ -3245,8 +3243,6 @@ int ext4_orphan_del(handle_t *handle, st
+       if (!sbi->s_journal && !(sbi->s_mount_state & EXT4_ORPHAN_FS))
+               return 0;
+-      WARN_ON_ONCE(!(inode->i_state & (I_NEW | I_FREEING)) &&
+-                   !mutex_is_locked(&inode->i_mutex));
+       /* Do this quick check before taking global s_orphan_lock. */
+       if (list_empty(&ei->i_orphan))
+               return 0;