Whamcloud - gitweb
LU-17744 ldiskfs: mballoc stats fixes
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / linux-5.8 / ext4-no-max-dir-size-limit-for-iam-objects.patch
1 ---
2  fs/ext4/ext4.h  |    1 +
3  fs/ext4/namei.c |    6 ++++--
4  2 files changed, 5 insertions(+), 2 deletions(-)
5
6 --- a/fs/ext4/ext4.h
7 +++ b/fs/ext4/ext4.h
8 @@ -1716,6 +1716,7 @@ enum {
9         EXT4_STATE_NO_EXPAND,           /* No space for expansion */
10         EXT4_STATE_DA_ALLOC_CLOSE,      /* Alloc DA blks on close */
11         EXT4_STATE_EXT_MIGRATE,         /* Inode is migrating */
12 +       EXT4_STATE_IAM,                 /* Lustre IAM objects */
13         EXT4_STATE_NEWENTRY,            /* File just added to dir */
14         EXT4_STATE_MAY_INLINE_DATA,     /* may have in-inode data */
15         EXT4_STATE_EXT_PRECACHED,       /* extents have been precached */
16 --- a/fs/ext4/namei.c
17 +++ b/fs/ext4/namei.c
18 @@ -60,8 +60,10 @@ struct buffer_head *ext4_append(handle_t
19  
20         if (unlikely(EXT4_SB(inode->i_sb)->s_max_dir_size_kb &&
21                      ((inode->i_size >> 10) >=
22 -                     EXT4_SB(inode->i_sb)->s_max_dir_size_kb)))
23 -               return ERR_PTR(-ENOSPC);
24 +                     EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) {
25 +               if (!ext4_test_inode_state(inode, EXT4_STATE_IAM))
26 +                       return ERR_PTR(-ENOSPC);
27 +       }
28  
29         /* with parallel dir operations all appends
30         * have to be serialized -bzzz */