summaryrefslogtreecommitdiff
path: root/fs/ext4/verity.c
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2020-05-28 08:00:02 -0700
committerTheodore Ts'o <tytso@mit.edu>2020-05-28 22:09:47 -0400
commitb383a73f2b832491a2f9e6e8ada26aad53b5763d (patch)
tree1631eb8ee0a22c9116196cf92d679e6e40b3f674 /fs/ext4/verity.c
parentfcebc7949cd2ff97407e5b77ed99a7211674c6de (diff)
fs/ext4: Introduce DAX inode flag
Add a flag ([EXT4|FS]_DAX_FL) to preserve FS_XFLAG_DAX in the ext4 inode. Set the flag to be user visible and changeable. Set the flag to be inherited. Allow applications to change the flag at any time except if it conflicts with the set of mutually exclusive flags (Currently VERITY, ENCRYPT, JOURNAL_DATA). Furthermore, restrict setting any of the exclusive flags if DAX is set. While conceptually possible, we do not allow setting EXT4_DAX_FL while at the same time clearing exclusion flags (or vice versa) for 2 reasons: 1) The DAX flag does not take effect immediately which introduces quite a bit of complexity 2) There is no clear use case for being this flexible Finally, on regular files, flag the inode to not be cached to facilitate changing S_DAX on the next creation of the inode. Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20200528150003.828793-9-ira.weiny@intel.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/verity.c')
-rw-r--r--fs/ext4/verity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c
index 89a155ece323..4fecb3e4e338 100644
--- a/fs/ext4/verity.c
+++ b/fs/ext4/verity.c
@@ -113,7 +113,7 @@ static int ext4_begin_enable_verity(struct file *filp)
handle_t *handle;
int err;
- if (IS_DAX(inode))
+ if (IS_DAX(inode) || ext4_test_inode_flag(inode, EXT4_INODE_DAX))
return -EINVAL;
if (ext4_verity_in_progress(inode))