fs/ext4: Narrow scope of DAX check in setflags
authorIra Weiny <ira.weiny@intel.com>
Thu, 28 May 2020 14:59:55 +0000 (07:59 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 29 May 2020 02:09:46 +0000 (22:09 -0400)
When preventing DAX and journaling on an inode.  Use the effective DAX
check rather than the mount option.

This will be required to support per inode DAX flags.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20200528150003.828793-2-ira.weiny@intel.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ioctl.c

index bfc1281fc4cbcbecca95cc2582690a02eb22e70f..5813e5e73eab6dc5e408b22c8ef319812a14476e 100644 (file)
@@ -393,9 +393,9 @@ flags_err:
        if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) {
                /*
                 * Changes to the journaling mode can cause unsafe changes to
-                * S_DAX if we are using the DAX mount option.
+                * S_DAX if the inode is DAX
                 */
-               if (test_opt(inode->i_sb, DAX)) {
+               if (IS_DAX(inode)) {
                        err = -EBUSY;
                        goto flags_out;
                }