Patch "ext4: allow the dax flag to be set and cleared on inline directories" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ext4: allow the dax flag to be set and cleared on inline directories

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-allow-the-dax-flag-to-be-set-and-cleared-on-inline-directories.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 4811d9929cdae4238baf5b2522247bd2f9fa7b50 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@xxxxxxx>
Date: Mon, 12 Apr 2021 17:19:00 -0400
Subject: ext4: allow the dax flag to be set and cleared on inline directories

From: Theodore Ts'o <tytso@xxxxxxx>

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@xxxxxxxxxx
Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/ext4/ialloc.c |    3 ++-
 fs/ext4/ioctl.c  |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

--- 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);
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -312,6 +312,12 @@ static void ext4_dax_dontcache(struct in
 static bool dax_compatible(struct inode *inode, unsigned int oldflags,
 			   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 ((oldflags & EXT4_DAX_MUT_EXCL) ||
 		     ext4_test_inode_state(inode,


Patches currently in stable-queue which might be from tytso@xxxxxxx are

queue-5.10/ext4-fix-error-code-in-ext4_commit_super.patch
queue-5.10/fs-fix-reporting-supported-extra-file-attributes-for-statx.patch
queue-5.10/ext4-fix-occasional-generic-418-failure.patch
queue-5.10/ext4-do-not-set-sb_active-in-ext4_orphan_cleanup.patch
queue-5.10/ext4-fix-error-return-code-in-ext4_fc_perform_commit.patch
queue-5.10/ext4-annotate-data-race-in-start_this_handle.patch
queue-5.10/ext4-fix-check-to-prevent-false-positive-report-of-incorrect-used-inodes.patch
queue-5.10/ext4-allow-the-dax-flag-to-be-set-and-cleared-on-inline-directories.patch
queue-5.10/random-initialize-chacha20-constants-with-correct-en.patch
queue-5.10/ext4-annotate-data-race-in-jbd2_journal_dirty_metadata.patch
queue-5.10/ext4-fix-ext4_error_err-save-negative-errno-into-superblock.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux