summaryrefslogtreecommitdiff
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-04-13 00:19:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 15:47:38 +0300
commit133e83b5b3b337591b3e35e79c607fbfe82e5e44 (patch)
tree495b121163b0db4b3386f9cbe232cf66fd2d8ae8 /fs/ext4/ialloc.c
parent72447c925ea90800da153413098c796e4ba6c150 (diff)
downloadlinux-133e83b5b3b337591b3e35e79c607fbfe82e5e44.tar.xz
ext4: allow the dax flag to be set and cleared on inline directories
commit 4811d9929cdae4238baf5b2522247bd2f9fa7b50 upstream. This is needed to allow generic/607 to pass for file systems with the inline data_feature enabled, and it allows the use of file systems where the directories use inline_data, while the files are accessed via DAX. Cc: stable@kernel.org Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r--fs/ext4/ialloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index a7ef18a913b7..c92558ede623 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1291,7 +1291,8 @@ got:
ei->i_extra_isize = sbi->s_want_extra_isize;
ei->i_inline_off = 0;
- if (ext4_has_feature_inline_data(sb))
+ if (ext4_has_feature_inline_data(sb) &&
+ (!(ei->i_flags & EXT4_DAX_FL) || S_ISDIR(mode)))
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
ret = inode;
err = dquot_alloc_inode(inode);