From a73f4e566debadfc156b6d8c48237a2e34ac75ba Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Fri, 4 Sep 2020 09:34:34 +1000 Subject: [PATCH] LU-13187 osd-ldiskfs: don't enforce max dir size limit on IAM objects Add ext4-no-max-dir-size-limit-for-iam-objects.patch to introduce new inode state EXT4_STATE_IAM and use it to mark IAM objects. Lustre-change: https://review.whamcloud.com/39823 Lustre-commit: 03e6db505be90d35ccacb3af7e15277784e5d448 Change-Id: I3bcc5435ea07edb9fa265dcd8e3261d849495f00 Signed-off-by: Li Dongyang Reviewed-by: Neil Brown Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-on: https://review.whamcloud.com/39882 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- ...xt4-no-max-dir-size-limit-for-iam-objects.patch | 29 ++++++++++++++++++++++ .../series/ldiskfs-3.10-rhel7.6.series | 1 + .../series/ldiskfs-3.10-rhel7.7.series | 1 + .../series/ldiskfs-3.10-rhel7.8.series | 1 + .../series/ldiskfs-4.15.0-20-ubuntu18.series | 1 + .../series/ldiskfs-4.15.0-24-ubuntu18.series | 1 + .../series/ldiskfs-4.4-sles12sp2.series | 1 + .../series/ldiskfs-4.4-sles12sp3.series | 1 + lustre/osd-ldiskfs/osd_oi.c | 1 + 9 files changed, 37 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/patches/base/ext4-no-max-dir-size-limit-for-iam-objects.patch b/ldiskfs/kernel_patches/patches/base/ext4-no-max-dir-size-limit-for-iam-objects.patch new file mode 100644 index 0000000..d5c83bb --- /dev/null +++ b/ldiskfs/kernel_patches/patches/base/ext4-no-max-dir-size-limit-for-iam-objects.patch @@ -0,0 +1,29 @@ +Index: linux-3.10.0-957.27.2.el7/fs/ext4/ext4.h +=================================================================== +--- linux-3.10.0-957.27.2.el7.orig/fs/ext4/ext4.h ++++ linux-3.10.0-957.27.2.el7/fs/ext4/ext4.h +@@ -1539,6 +1539,7 @@ enum { + EXT4_STATE_NO_EXPAND, /* No space for expansion */ + EXT4_STATE_DA_ALLOC_CLOSE, /* Alloc DA blks on close */ + EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */ ++ EXT4_STATE_IAM, /* Lustre IAM objects */ + EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/ + EXT4_STATE_NEWENTRY, /* File just added to dir */ + EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read +Index: linux-3.10.0-957.27.2.el7/fs/ext4/namei.c +=================================================================== +--- linux-3.10.0-957.27.2.el7.orig/fs/ext4/namei.c ++++ linux-3.10.0-957.27.2.el7/fs/ext4/namei.c +@@ -58,8 +58,10 @@ struct buffer_head *ext4_append(handle_t + + if (unlikely(EXT4_SB(inode->i_sb)->s_max_dir_size_kb && + ((inode->i_size >> 10) >= +- EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) +- return ERR_PTR(-ENOSPC); ++ EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) { ++ if (!ext4_test_inode_state(inode, EXT4_STATE_IAM)) ++ return ERR_PTR(-ENOSPC); ++ } + + /* with parallel dir operations all appends + * have to be serialized -bzzz */ diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.6.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.6.series index 94a4c07..1d7cce6 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.6.series @@ -40,3 +40,4 @@ rhel7.2/ext4-export-mb-stream-allocator-variables.patch rhel7/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch rhel7.2/ext4-simple-blockalloc.patch rhel7/ext4-mballoc-skip-uninit-groups-cr0.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.7.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.7.series index 47592d7..5fb0664 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.7.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.7.series @@ -40,3 +40,4 @@ rhel7.7/ext4-fix-project-with-unpatched-kernel.patch rhel7/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch rhel7.2/ext4-simple-blockalloc.patch rhel7/ext4-mballoc-skip-uninit-groups-cr0.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.8.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.8.series index 47592d7..5fb0664 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.8.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.8.series @@ -40,3 +40,4 @@ rhel7.7/ext4-fix-project-with-unpatched-kernel.patch rhel7/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch rhel7.2/ext4-simple-blockalloc.patch rhel7/ext4-mballoc-skip-uninit-groups-cr0.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-20-ubuntu18.series b/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-20-ubuntu18.series index 46114cd..8308229 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-20-ubuntu18.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-20-ubuntu18.series @@ -22,3 +22,4 @@ rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch rhel7/ext4-export-orphan-add.patch rhel7/ext4-mmp-dont-mark-bh-dirty.patch ubuntu18/ext4-include-terminating-u32-in-size-of-xattr-entries-when-expanding-inodes.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-24-ubuntu18.series b/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-24-ubuntu18.series index 5c6c4a9..6251dfa 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-24-ubuntu18.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-4.15.0-24-ubuntu18.series @@ -23,3 +23,4 @@ rhel7/ext4-export-orphan-add.patch rhel7/ext4-mmp-dont-mark-bh-dirty.patch ubuntu18/ext4-include-terminating-u32-in-size-of-xattr-entries-when-expanding-inodes.patch sles12sp2/ext4-export-mb-stream-allocator-variables.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp2.series b/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp2.series index 6b6e2d5..d633d98 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp2.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp2.series @@ -30,3 +30,4 @@ rhel7/ext4-mmp-dont-mark-bh-dirty.patch rhel7/ext4-include-terminating-u32-in-size-of-xattr-entries-when-expanding-inodes.patch sles12sp2/ext4-export-mb-stream-allocator-variables.patch rhel7/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp3.series b/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp3.series index e247d1a..2057e68 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp3.series @@ -29,3 +29,4 @@ rhel7/ext4-export-orphan-add.patch rhel7/ext4-include-terminating-u32-in-size-of-xattr-entries-when-expanding-inodes.patch sles12sp2/ext4-export-mb-stream-allocator-variables.patch rhel7/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch +base/ext4-no-max-dir-size-limit-for-iam-objects.patch diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index 9d17ad8..a52a1f5 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -224,6 +224,7 @@ static int osd_oi_open(struct osd_thread_info *info, struct osd_device *osd, inode = osd_oi_index_open(info, osd, name, &oi_feat, create); if (IS_ERR(inode)) RETURN(PTR_ERR(inode)); + ldiskfs_set_inode_state(inode, LDISKFS_STATE_IAM); if (!osd->od_dt_dev.dd_rdonly) { /* 'What the @fid is' is not imporatant, because these objects -- 1.8.3.1