+++ /dev/null
-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-229.1.2.fc21.x86_64/fs/ext4/inode.c
-===================================================================
---- 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.
- */
-- if (!(inode->i_state & (I_NEW|I_FREEING)))
-- WARN_ON(!mutex_is_locked(&inode->i_mutex));
- 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;
+++ /dev/null
-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-229.1.2.fc21.x86_64/fs/ext4/inode.c
-===================================================================
---- 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.
- */
-- if (!(inode->i_state & (I_NEW|I_FREEING)))
-- WARN_ON(!mutex_is_locked(&inode->i_mutex));
- trace_ext4_truncate_enter(inode);
-
- if (!ext4_can_truncate(inode))
+++ /dev/null
-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;
rhel7/ext4-large-dir.patch
rhel7.2/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7/ext4-large-dir.patch
rhel7.2/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7.3/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7.4/ext4-large-dir.patch
rhel7.4/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7.3/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7.4/ext4-large-dir.patch
rhel7.4/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7.3/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7.4/ext4-large-dir.patch
rhel7.4/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7.6/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7.7/ext4-large-dir.patch
rhel7.7/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7.6/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7/ext4-large-dir.patch
rhel7/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
rhel7/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
rhel7/ext4-large-dir.patch
sles12/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-sles12/ext4-remove-truncate-warning.patch
sles12/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
sles12sp1/ext4-large-dir.patch
sles12/ext4-pdirop.patch
rhel7/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
rhel7/ext4-give-warning-with-dir-htree-growing.patch
rhel7/ext4-mmp-brelse.patch
ubuntu18/ext4-nocmtime.patch
ubuntu18/ext4-pdirop.patch
sles12sp2/ext4-max-dir-size.patch
-ubuntu18/ext4-remove-truncate-warning.patch
ubuntu18/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
ubuntu18/ext4-give-warning-with-dir-htree-growing.patch
ubuntu18/ext4-jcb-optimization.patch
ubuntu18/ext4-nocmtime.patch
ubuntu18/ext4-pdirop.patch
sles12sp2/ext4-max-dir-size.patch
-ubuntu18/ext4-remove-truncate-warning.patch
ubuntu18/ext4-corrupted-inode-block-bitmaps-handling-patches-001.patch
ubuntu18/ext4-give-warning-with-dir-htree-growing.patch
ubuntu18/ext4-jcb-optimization.patch
rhel8/ext4-nocmtime.patch
rhel8/ext4-pdirop.patch
sles12sp3/ext4-max-dir-size.patch
-ubuntu18/ext4-remove-truncate-warning.patch
rhel8/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
ubuntu18/ext4-give-warning-with-dir-htree-growing.patch
ubuntu18/ext4-jcb-optimization.patch
sles12sp2/ext4-large-dir.patch
sles12sp2/ext4-pdirop.patch
sles12sp2/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp2/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
sles12sp3/ext4-large-dir.patch
sles12sp3/ext4-pdirop.patch
sles12sp3/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp3/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
ubuntu14+16/ext4-large-dir.patch
ubuntu14+16/ext4-pdirop.patch
sles12sp2/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp2/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
ubuntu14+16/ext4-large-dir.patch
ubuntu14+16/ext4-pdirop-001.patch
sles12sp2/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp2/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
ubuntu14+16/ext4-large-dir-001.patch
ubuntu14+16/ext4-pdirop-001.patch
sles12sp2/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp2/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
ubuntu14+16/ext4-large-dir-001.patch
ubuntu14+16/ext4-pdirop-001.patch
sles12sp2/ext4-max-dir-size.patch
-rhel7/ext4-remove-truncate-warning.patch
sles12sp2/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
sles12sp2/ext4-give-warning-with-dir-htree-growing.patch
sles12sp2/ext4-mmp-brelse.patch
rhel8/ext4-nocmtime.patch
rhel8/ext4-pdirop.patch
sles12sp3/ext4-max-dir-size.patch
-ubuntu18/ext4-remove-truncate-warning.patch
rhel8/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
ubuntu18/ext4-give-warning-with-dir-htree-growing.patch
ubuntu18/ext4-jcb-optimization.patch
return;
}
+ inode_lock(inode);
ldiskfs_truncate(inode);
+ inode_unlock(inode);
/*
* For a partial-page truncate, flush the page to disk immediately to