Commit 03e6db50 authored by Li Dongyang's avatar Li Dongyang Committed by Oleg Drokin
Browse files

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.

Test-Parameter: testlist=sanity env=ONLY=129,ONLY_REPEAT=100
Change-Id: I3bcc5435ea07edb9fa265dcd8e3261d849495f00
Signed-off-by: default avatarLi Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/39823

Tested-by: default avatarjenkins <devops@whamcloud.com>
Reviewed-by: default avatarNeil Brown <neilb@suse.de>
Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
parent 6f5d22c9
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 */
......@@ -47,3 +47,4 @@ rhel7.6/ext4-move-handling-of-list-of-shrinkable-inodes-into.patch
rhel7.6/ext4-limit-number-of-scanned-extents-in-status-tree-.patch
rhel7.6/ext4-cleanup-flag-definitions-for-extent-status-tree.patch
rhel7.6/ext4-introduce-aging-to-extent-status-tree.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -47,3 +47,4 @@ rhel7.6/ext4-move-handling-of-list-of-shrinkable-inodes-into.patch
rhel7.6/ext4-limit-number-of-scanned-extents-in-status-tree-.patch
rhel7.6/ext4-cleanup-flag-definitions-for-extent-status-tree.patch
rhel7.6/ext4-introduce-aging-to-extent-status-tree.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -47,3 +47,4 @@ rhel7.6/ext4-move-handling-of-list-of-shrinkable-inodes-into.patch
rhel7.6/ext4-limit-number-of-scanned-extents-in-status-tree-.patch
rhel7.6/ext4-cleanup-flag-definitions-for-extent-status-tree.patch
rhel7.6/ext4-introduce-aging-to-extent-status-tree.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel7.6/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
rhel7.6/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch
rhel7.6/ext4-export-orphan-add.patch
suse15/ext4-export-mb-stream-allocator-variables.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel7.6/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
rhel7.6/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch
rhel7.6/ext4-export-orphan-add.patch
suse15/ext4-export-mb-stream-allocator-variables.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel7.6/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
rhel7.6/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch
rhel7.6/ext4-export-orphan-add.patch
suse15/ext4-export-mb-stream-allocator-variables.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel7.6/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
rhel7.6/ext4-optimize-ext4_find_delalloc_range-in-nodelalloc.patch
rhel7.6/ext4-export-orphan-add.patch
suse15/ext4-export-mb-stream-allocator-variables.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -22,3 +22,4 @@ rhel7.6/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
rhel7.6/ext4-export-orphan-add.patch
rhel7.6/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
......@@ -23,3 +23,4 @@ rhel7.6/ext4-export-orphan-add.patch
rhel7.6/ext4-mmp-dont-mark-bh-dirty.patch
ubuntu18/ext4-include-terminating-u32-in-size-of-xattr-entries-when-expanding-inodes.patch
suse15/ext4-export-mb-stream-allocator-variables.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel8/ext4-simple-blockalloc.patch
rhel8/ext4-mballoc-skip-uninit-groups-cr0.patch
rhel8.1/ext4-mballoc-prefetch.patch
rhel8/ext4-xattr-disable-credits-check.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ rhel8/ext4-simple-blockalloc.patch
rhel8/ext4-mballoc-skip-uninit-groups-cr0.patch
rhel8.1/ext4-mballoc-prefetch.patch
rhel8/ext4-xattr-disable-credits-check.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -26,3 +26,4 @@ rhel8/ext4-simple-blockalloc.patch
rhel8/ext4-mballoc-skip-uninit-groups-cr0.patch
rhel8/ext4-mballoc-prefetch.patch
rhel8/ext4-xattr-disable-credits-check.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -23,3 +23,4 @@ rhel7.6/ext4-export-orphan-add.patch
rhel8/ext4-export-mb-stream-allocator-variables.patch
ubuntu19/ext4-iget-with-flags.patch
rhel8/ext4-simple-blockalloc.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -25,3 +25,4 @@ ubuntu19/ext4-iget-with-flags.patch
linux-5.4/export-ext4fs-dirhash-helper.patch
linux-5.4/ext4-misc.patch
rhel8/ext4-simple-blockalloc.patch
base/ext4-no-max-dir-size-limit-for-iam-objects.patch
......@@ -226,6 +226,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment