Whamcloud - gitweb
LU-12977 ldiskfs: properly take inode_lock() for truncates
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ubuntu18 / ext4-remove-truncate-warning.patch
diff --git a/ldiskfs/kernel_patches/patches/ubuntu18/ext4-remove-truncate-warning.patch b/ldiskfs/kernel_patches/patches/ubuntu18/ext4-remove-truncate-warning.patch
deleted file mode 100644 (file)
index 17bc7e3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-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-4.15.0/fs/ext4/inode.c
-===================================================================
---- linux-4.15.0.orig/fs/ext4/inode.c
-+++ linux-4.15.0/fs/ext4/inode.c
-@@ -4398,8 +4398,6 @@ int ext4_truncate(struct inode *inode)
-        * or it's a completely new inode. In those cases we might not
-        * have i_mutex locked because it's not necessary.
-        */
--      if (!(inode->i_state & (I_NEW|I_FREEING)))
--              WARN_ON(!inode_is_locked(inode));
-       trace_ext4_truncate_enter(inode);
-       if (!ext4_can_truncate(inode))
-Index: linux-4.15.0/fs/ext4/namei.c
-===================================================================
---- linux-4.15.0.orig/fs/ext4/namei.c
-+++ linux-4.15.0/fs/ext4/namei.c
-@@ -3370,8 +3370,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)) &&
--                   !inode_is_locked(inode));
-       /*
-        * 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.
-@@ -3452,8 +3450,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)) &&
--                   !inode_is_locked(inode));
-       /* Do this quick check before taking global s_orphan_lock. */
-       if (list_empty(&ei->i_orphan))
-               return 0;