mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
ext4: allow the dax flag to be set and cleared on inline directories
commit 4811d9929c 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>
This commit is contained in:
parent
72447c925e
commit
133e83b5b3
|
|
@ -1291,7 +1291,8 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
|
||||||
|
|
||||||
ei->i_extra_isize = sbi->s_want_extra_isize;
|
ei->i_extra_isize = sbi->s_want_extra_isize;
|
||||||
ei->i_inline_off = 0;
|
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);
|
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
|
||||||
ret = inode;
|
ret = inode;
|
||||||
err = dquot_alloc_inode(inode);
|
err = dquot_alloc_inode(inode);
|
||||||
|
|
|
||||||
|
|
@ -312,6 +312,12 @@ static void ext4_dax_dontcache(struct inode *inode, unsigned int flags)
|
||||||
static bool dax_compatible(struct inode *inode, unsigned int oldflags,
|
static bool dax_compatible(struct inode *inode, unsigned int oldflags,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
/* Allow the DAX flag to be changed on inline directories */
|
||||||
|
if (S_ISDIR(inode->i_mode)) {
|
||||||
|
flags &= ~EXT4_INLINE_DATA_FL;
|
||||||
|
oldflags &= ~EXT4_INLINE_DATA_FL;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & EXT4_DAX_FL) {
|
if (flags & EXT4_DAX_FL) {
|
||||||
if ((oldflags & EXT4_DAX_MUT_EXCL) ||
|
if ((oldflags & EXT4_DAX_MUT_EXCL) ||
|
||||||
ext4_test_inode_state(inode,
|
ext4_test_inode_state(inode,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user