Whamcloud - gitweb
LU-13187 osd-ldiskfs: don't enforce max dir size limit on IAM objects
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / base / ext4-no-max-dir-size-limit-for-iam-objects.patch
1 Index: linux-3.10.0-957.27.2.el7/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-3.10.0-957.27.2.el7.orig/fs/ext4/ext4.h
4 +++ linux-3.10.0-957.27.2.el7/fs/ext4/ext4.h
5 @@ -1539,6 +1539,7 @@ enum {
6         EXT4_STATE_NO_EXPAND,           /* No space for expansion */
7         EXT4_STATE_DA_ALLOC_CLOSE,      /* Alloc DA blks on close */
8         EXT4_STATE_EXT_MIGRATE,         /* Inode is migrating */
9 +       EXT4_STATE_IAM,                 /* Lustre IAM objects */
10         EXT4_STATE_DIO_UNWRITTEN,       /* need convert on dio done*/
11         EXT4_STATE_NEWENTRY,            /* File just added to dir */
12         EXT4_STATE_DIOREAD_LOCK,        /* Disable support for dio read
13 Index: linux-3.10.0-957.27.2.el7/fs/ext4/namei.c
14 ===================================================================
15 --- linux-3.10.0-957.27.2.el7.orig/fs/ext4/namei.c
16 +++ linux-3.10.0-957.27.2.el7/fs/ext4/namei.c
17 @@ -58,8 +58,10 @@ struct buffer_head *ext4_append(handle_t
18  
19         if (unlikely(EXT4_SB(inode->i_sb)->s_max_dir_size_kb &&
20                      ((inode->i_size >> 10) >=
21 -                     EXT4_SB(inode->i_sb)->s_max_dir_size_kb)))
22 -               return ERR_PTR(-ENOSPC);
23 +                     EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) {
24 +               if (!ext4_test_inode_state(inode, EXT4_STATE_IAM))
25 +                       return ERR_PTR(-ENOSPC);
26 +       }
27  
28         /* with parallel dir operations all appends
29         * have to be serialized -bzzz */