Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/ext4: Disallow verity if inode is DAX

Verity and DAX are incompatible. Changing the DAX mode due to a verity
flag change is wrong without a corresponding address_space_operations
update.

Make the 2 options mutually exclusive by returning an error if DAX was
set first.

(Setting DAX is already disabled if Verity is set first.)

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Link: https://lore.kernel.org/r/20200528150003.828793-3-ira.weiny@intel.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Ira Weiny and committed by
Theodore Ts'o
6c0d077f ff694ab6

+6
+3
Documentation/filesystems/ext4/verity.rst
··· 39 39 40 40 Verity files cannot have blocks allocated past the end of the verity 41 41 metadata. 42 + 43 + Verity and DAX are not compatible and attempts to set both of these flags 44 + on a file will fail.
+3
fs/ext4/verity.c
··· 113 113 handle_t *handle; 114 114 int err; 115 115 116 + if (IS_DAX(inode)) 117 + return -EINVAL; 118 + 116 119 if (ext4_verity_in_progress(inode)) 117 120 return -EBUSY; 118 121