3 fs/ext4/namei.c | 6 ++++--
4 2 files changed, 5 insertions(+), 2 deletions(-)
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 */
18 @@ -60,8 +60,10 @@ struct buffer_head *ext4_append(handle_t
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);
29 /* with parallel dir operations all appends
30 * have to be serialized -bzzz */