fsverity: lift ioctl() input masking and runtime inode flag to VFS
Subsystems (5)
v2 cover fsverity: lift ioctl() input masking and runtime inode flag to VFS
Hi folks,
This patchset lifts two things from filesystems to VFS level:
- No-oping FS_VERITY_FL in SET ioctl()
- runtime fsverity construction flag
The first one fixes BTRFS get-modify-set loop with FS_IOC_GETFLAGS/SETFLAGS ioctl()s, as it does return fsverity flag but not mask it out.
Testing, -g verity passes for all fs, except btrfs/277 and btrfs+generic/574.
The btrfs/277 seems to fail due to difference between what kernel and userspace versions support (btrfs-progs v7.1 doesn't seem to support latest streams v3).
The generic/574 on BTRFS fails only for 1024 block size no matter the change (fails on v7.3 too). I haven't checked why.
Changes in v2:
- Return ret in btrfs_begin_enable_verity()
- Include linux-fsdevel
Andrey Albershteyn (5):
fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS
fsverity: add I_VERITY_BUILDING inode state flag
btrfs: use I_VERITY_BUILDING instead of private flags
ext4: use I_VERITY_BUILDING instead of private flags
f2fs: use I_VERITY_BUILDING instead of private flags
fs/btrfs/btrfs_inode.h | 7 ------- fs/btrfs/verity.c | 14 +++----------- fs/ext4/ext4.h | 7 ------- fs/ext4/file.c | 2 +- fs/ext4/inode.c | 17 +++++++++-------- fs/ext4/ioctl.c | 3 +-- fs/ext4/verity.c | 18 +++++------------- fs/f2fs/data.c | 10 +++++----- fs/f2fs/f2fs.h | 7 ------- fs/f2fs/verity.c | 15 ++++----------- fs/file_attr.c | 10 ++++++++++ fs/verity/enable.c | 22 +++++++++++++++++++--- include/linux/fs.h | 6 ++++++ include/linux/fsverity.h | 21 +++++++++++++++++++++ 14 files changed, 84 insertions(+), 75 deletions(-)
Signature · 1 line
2.54.0
PATCH v2 1/5 fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS
The common use of FS_IOC_GETFLAGS/SETFLAGS is get-modify-set loop. Filesystems could return verity status with GETFLAGS, attempting to then pass FS_VERITY_FL to SETFLAGS is not allowed.
The ext4 and f2fs already treat FS_VERITY_FL in the set path as no-op, however, BTRFS returns -EOPNOTSUPP. So, the modification of other flags doesn't work on BTRFS for fsverity inodes.
Fix it for BTRFS and anyone else, the ext4 and f2fs masking becomes no-op. The file_get/setattr() path is fine here as this flag is cleared right before fileattr_set_prepare(). The future fsverity support in XFS would also need it.
--- fs/file_attr.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/file_attr.c +10 -0
@@ -199,6 +199,16 @@ static int fileattr_set_prepare(struct inode *inode,if (err)return err; +/* +* verity is settable only via FS_IOC_ENABLE_VERITY; never through +* fileattr +* +* Treat it as a no-op so the FS_IOC_GETFLAGS/SETFLAGS round-trip +* doesn't break for other flags +*/ + fa->flags &= ~FS_VERITY_FL ; + fa->fsx_xflags &= ~FS_XFLAG_VERITY ; +/* * Project Quota ID state is only allowed to change from within the init * namespace. Enforce that restriction only if we are trying to change
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [f2fs-dev] [PATCH v2 1/5] fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS
Sashiko has reviewed this patch and found no issues.
Quoted 13 lines
The common use of FS_IOC_GETFLAGS/SETFLAGS is get-modify-set loop. Filesystems could return verity status with GETFLAGS, attempting to then pass
FS_VERITY_FLto SETFLAGS is not allowed.The ext4 and f2fs already treat
FS_VERITY_FLin the set path as no-op, however, BTRFS returns-EOPNOTSUPP. So, the modification of other flags doesn't work on BTRFS for fsverity inodes.Fix it for BTRFS and anyone else, the ext4 and f2fs masking becomes no-op. The file_get/setattr() path is fine here as this flag is cleared right before
fileattr_set_prepare(). The future fsverity support in XFS would also need it.
Quoted 4 lines
Cc Boris Burkov <[email protected]>Cc David Sterba <[email protected]>Fixes 146054090b08 ("btrfs: initial fsverity support")Signed-off-by Andrey Albershteyn <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v2 1/5] fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS
In reply to Andrey AlbershteynQuoted 26 lines · Andrey Albershteyn
The common use of FS_IOC_GETFLAGS/SETFLAGS is get-modify-set loop. Filesystems could return verity status with GETFLAGS, attempting to then pass
FS_VERITY_FLto SETFLAGS is not allowed.The ext4 and f2fs already treat
FS_VERITY_FLin the set path as no-op, however, BTRFS returns-EOPNOTSUPP. So, the modification of other flags doesn't work on BTRFS for fsverity inodes.Fix it for BTRFS and anyone else, the ext4 and f2fs masking becomes no-op. The file_get/setattr() path is fine here as this flag is cleared right before
fileattr_set_prepare(). The future fsverity support in XFS would also need it.Cc Boris Burkov <[email protected]>Cc David Sterba <[email protected]>Fixes 146054090b08 ("btrfs: initial fsverity support")Signed-off-by Andrey Albershteyn <[email protected]>--- fs/file_attr.c | 10 ++++++++++ 1 file changed, 10 insertions(+)fs/file_attr.c +0
-0
fs/file_attr.c static int fileattr_set_prepare(struct inode *inode, · line 204
Quoted 6 lines
fs/file_attr.c +3
-0@@ -199,6 +199,16 @@ static int fileattr_set_prepare(struct inode *inode,if (err)return err; +/* +* verity is settable only via FS_IOC_ENABLE_VERITY; never through +* fileattr
Maybe spell out FS_VERITY_FL above? Starting the sentence with a lower case letter looks odd, and spelling out the flag name doens't hurt.
Otherwise looks good:
Eric Biggers
maintainerRe: [PATCH v2 1/5] fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS
In reply to Andrey AlbershteynQuoted 1 line · Andrey Albershteyn
[PATCH v2 1/5] fsverity: strip
FS_VERITY_FLfromFS_IOC_SETFLAGS
Should use the "fs:" prefix for this one, since it only changes fs/file_attr.c.
- Eric
PATCH v2 2/5 fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey AlbershteynEvery filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built *_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with -EBUSY and let the write paths recognize the special writes done while the tree is under construction.
Hoist this flag into the VFS as a new inode state flag, I_VERITY_BUILDING, and manage its lifetime in the generic fs-verity enable path. The flag is set after ->begin_enable_verity() succeeds and cleared after ->end_enable_verity() returns (both on the success and the rollback paths). Add the concurrent-enable guard.
A new helper, fsverity_is_building(), is provided for filesystems to query the flag. No filesystem uses it yet; the per-fs flags are converted in following patches.
--- fs/verity/enable.c | 22 +++++++++++++++++++--- include/linux/fs.h | 6 ++++++ include/linux/fsverity.h | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-)
fs/verity/enable.c +19 -3
@@ -229,13 +229,23 @@ static int enable_verity(struct file *filp,/* * Start enabling verity on this file, serialized by the inode lock. -* Fail if verity is already enabled or is already being enabled. +* Fail if verity is already enabled or is already being enabled. Set +* I_VERITY_BUILDING inode runtime flag which will be cleared when +* enablement succeeded or rolled back. */ inode_lock (inode); -if (IS_VERITY (inode)) +if (IS_VERITY (inode)) { err = -EEXIST ; -else + }else if (inode_state_read_once (inode) &I_VERITY_BUILDING ) { + err = -EBUSY ; + }else { err = vops->begin_enable_verity (filp); +if (!err) { +spin_lock (&inode->i_lock); +inode_state_set (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock); + } + }inode_unlock (inode);if (err) goto out;
@@ -291,6 +301,9 @@ static int enable_verity(struct file *filp,*/ inode_lock (inode); err = vops->end_enable_verity (filp, desc, desc_size, params.tree_size); +spin_lock (&inode->i_lock); +inode_state_clear (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock);inode_unlock (inode);if (err) { fsverity_err(inode, "%ps() failed with err %d",
@@ -317,6 +330,9 @@ static int enable_verity(struct file *filp, rollback:inode_lock (inode); (void )vops->end_enable_verity (filp,NULL ,0 , params.tree_size); +spin_lock (&inode->i_lock); +inode_state_clear (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock);inode_unlock (inode); goto out; }
include/linux/fs.h +6 -0
@@ -707,6 +707,11 @@ is_uncached_acl(struct posix_acl *acl)* I_LRU_ISOLATING Inode is pinned being isolated from LRU without holding * i_count. * +* I_VERITY_BUILDING fs-verity is being enabled on the inode: the Merkle +* tree is under construction. The file is effectively +* read-only to userspace; the only writes happening are +* for the fs-verity metadata. +* * Q: What is the difference between I_WILL_FREE and I_FREEING? * * __I_{SYNC,NEW,LRU_ISOLATING} are used to derive unique addresses to wait
@@ -741,6 +746,7 @@ enum inode_state_flags_enum {I_SYNC_QUEUED = (1U <<17 ),I_PINNING_NETFS_WB = (1U <<18 ),I_METADATA_WRITEBACK = (1U <<19 ), + I_VERITY_BUILDING = (1U << 20), };#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
include/linux/fsverity.h +21 -0
@@ -164,6 +164,22 @@ static inline bool fsverity_active(const struct inode *inode)return false; } +/** +* fsverity_is_building() - is fs-verity being enabled on the inode +* @inode: inode to check +* +* This checks whether the inode's Merkle tree is currently being built. +* While this is the case the file is read-only to userspace and the only writes +* allowed are for the fs-verity metadata. This becomes false when fsverity +* metadata is fully created and written to disk or building failed. +* +* Return: true if fs-verity is being enabled on the inode +*/ +static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ; +} +struct fsverity_info *__fsverity_get_info (const struct inode *inode);/** * fsverity_get_info - get fsverity information for an inode
@@ -217,6 +233,11 @@ static inline bool fsverity_active(const struct inode *inode)return false; } +static inline bool fsverity_is_building (const struct inode *inode) +{ +return false; +} +static inline struct fsverity_info *fsverity_get_info (const struct inode *inode) {return NULL ;
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [f2fs-dev] [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
Sashiko has reviewed this patch and found no issues.
Quoted 12 lines
Every filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built
*_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with-EBUSYand let the write paths recognize the special writes done while the tree is under construction.Hoist this flag into the VFS as a new inode state flag,
I_VERITY_BUILDING, and manage its lifetime in the generic fs-verity enable path. The flag is set after ->begin_enable_verity() succeeds and cleared after ->end_enable_verity() returns (both on the success and the rollback paths). Add the concurrent-enable guard.
Quoted 5 lines
A new helper,
fsverity_is_building(), is provided for filesystems to query the flag. No filesystem uses it yet; the per-fs flags are converted in following patches.Signed-off-by Andrey Albershteyn <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey AlbershteynLooks good:
Eric Biggers
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey Albershteynfs/verity/enable.c static int enable_verity(struct file *filp, · line 239
Quoted 1 line · Andrey Albershteyn
fs/verity/enable.c +1
-0+ }else if (inode_state_read_once (inode) &I_VERITY_BUILDING ) {
fsverity_is_building()?
include/linux/fsverity.h static inline bool fsverity_active(const struct inode *inode) · line 181
Quoted 4 lines
include/linux/fsverity.h +4
-0+static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ; +}
It would make more sense for inode_state_read_once() itself to take 'const struct inode *'. Then the cast wouldn't be needed.
- Eric
Eric Biggers
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
Quoted 5 lines · Eric Biggers
fs/verity/enable.c static int enable_verity(struct file *filp, · line 239
Quoted 1 line · Andrey Albershteyn
fs/verity/enable.c +1
-0+ }else if (inode_state_read_once (inode) &I_VERITY_BUILDING ) {
fsverity_is_building()?
Quoted 7 lines
include/linux/fsverity.h static inline bool fsverity_active(const struct inode *inode) · line 181
Quoted 4 lines
include/linux/fsverity.h +4
-0+static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ; +}It would make more sense for
inode_state_read_once()itself to take 'const struct inode *'. Then the cast wouldn't be needed.
Also, we should include an IS_ENABLED(CONFIG_FS_VERITY) check here, so that it gets compiled away to nothing if CONFIG_FS_VERITY is disabled.
- Eric
Eric Biggers
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
Quoted 14 lines · Eric Biggers
Quoted 5 lines · Eric Biggers
fs/verity/enable.c static int enable_verity(struct file *filp, · line 239
Quoted 1 line · Andrey Albershteyn
fs/verity/enable.c +1
-0+ }else if (inode_state_read_once (inode) &I_VERITY_BUILDING ) {
fsverity_is_building()?Quoted 7 lines
include/linux/fsverity.h static inline bool fsverity_active(const struct inode *inode) · line 181
Quoted 4 lines
include/linux/fsverity.h +4
-0+static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ; +}It would make more sense for
inode_state_read_once()itself to take 'const struct inode *'. Then the cast wouldn't be needed.
Quoted 2 lines
Also, we should include an
IS_ENABLED(CONFIG_FS_VERITY)check here, so that it gets compiled away to nothing ifCONFIG_FS_VERITYis disabled.
Never mind, it's already there in the !CONFIG_FS_VERITY section of the file.
- Eric
Eric Biggers
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey AlbershteynQuoted 12 lines · Andrey Albershteyn
Every filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built
*_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with-EBUSYand let the write paths recognize the special writes done while the tree is under construction.Hoist this flag into the VFS as a new inode state flag,
I_VERITY_BUILDING, and manage its lifetime in the generic fs-verity enable path. The flag is set after ->begin_enable_verity() succeeds and cleared after ->end_enable_verity() returns (both on the success and the rollback paths). Add the concurrent-enable guard.
Quoted 5 lines
A new helper,
fsverity_is_building(), is provided for filesystems to query the flag. No filesystem uses it yet; the per-fs flags are converted in following patches.Signed-off-by Andrey Albershteyn <[email protected]>
A couple things missing:
* Comment for fsverity_operations::begin_enable_verity needs to be updated, as it no longer has the -EBUSY case.
* show_inode_state() is missing the new flag.
- Eric
Christian Brauner
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey AlbershteynQuoted 110 lines · Andrey Albershteyn
Every filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built
*_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with-EBUSYand let the write paths recognize the special writes done while the tree is under construction.Hoist this flag into the VFS as a new inode state flag,
I_VERITY_BUILDING, and manage its lifetime in the generic fs-verity enable path. The flag is set after ->begin_enable_verity() succeeds and cleared after ->end_enable_verity() returns (both on the success and the rollback paths). Add the concurrent-enable guard.A new helper,
fsverity_is_building(), is provided for filesystems to query the flag. No filesystem uses it yet; the per-fs flags are converted in following patches.Signed-off-by Andrey Albershteyn <[email protected]>--- fs/verity/enable.c | 22 +++++++++++++++++++--- include/linux/fs.h | 6 ++++++ include/linux/fsverity.h | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-)fs/verity/enable.c +19
-3@@ -229,13 +229,23 @@ static int enable_verity(struct file *filp,/* * Start enabling verity on this file, serialized by the inode lock. -* Fail if verity is already enabled or is already being enabled. +* Fail if verity is already enabled or is already being enabled. Set +* I_VERITY_BUILDING inode runtime flag which will be cleared when +* enablement succeeded or rolled back. */ inode_lock (inode); -if (IS_VERITY (inode)) +if (IS_VERITY (inode)) { err = -EEXIST ; -else + }else if (inode_state_read_once (inode) &I_VERITY_BUILDING ) { + err = -EBUSY ; + }else { err = vops->begin_enable_verity (filp); +if (!err) { +spin_lock (&inode->i_lock); +inode_state_set (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock); + } + }inode_unlock (inode);if (err) goto out;@@ -291,6 +301,9 @@ static int enable_verity(struct file *filp,*/ inode_lock (inode); err = vops->end_enable_verity (filp, desc, desc_size, params.tree_size); +spin_lock (&inode->i_lock); +inode_state_clear (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock);inode_unlock (inode);if (err) { fsverity_err(inode, "%ps() failed with err %d",@@ -317,6 +330,9 @@ static int enable_verity(struct file *filp, rollback:inode_lock (inode); (void )vops->end_enable_verity (filp,NULL ,0 , params.tree_size); +spin_lock (&inode->i_lock); +inode_state_clear (inode,I_VERITY_BUILDING ); +spin_unlock (&inode->i_lock);inode_unlock (inode); goto out; }include/linux/fs.h +6
-0@@ -707,6 +707,11 @@ is_uncached_acl(struct posix_acl *acl)* I_LRU_ISOLATING Inode is pinned being isolated from LRU without holding * i_count. * +* I_VERITY_BUILDING fs-verity is being enabled on the inode: the Merkle +* tree is under construction. The file is effectively +* read-only to userspace; the only writes happening are +* for the fs-verity metadata. +* * Q: What is the difference between I_WILL_FREE and I_FREEING? * * __I_{SYNC,NEW,LRU_ISOLATING} are used to derive unique addresses to wait @@ -741,6 +746,7 @@ enum inode_state_flags_enum {I_SYNC_QUEUED = (1U <<17 ),I_PINNING_NETFS_WB = (1U <<18 ),I_METADATA_WRITEBACK = (1U <<19 ), + I_VERITY_BUILDING = (1U << 20), };#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)include/linux/fsverity.h +4
-0@@ -164,6 +164,22 @@ static inline bool fsverity_active(const struct inode *inode)return false; } +/** +* fsverity_is_building() - is fs-verity being enabled on the inode +* @inode: inode to check +*
include/linux/fsverity.h static inline bool fsverity_active(const struct inode *inode) · line 180
Quoted 10 lines
include/linux/fsverity.h +10
-0+* This checks whether the inode's Merkle tree is currently being built. +* While this is the case the file is read-only to userspace and the only writes +* allowed are for the fs-verity metadata. This becomes false when fsverity +* metadata is fully created and written to disk or building failed. +* +* Return: true if fs-verity is being enabled on the inode +*/ +static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ;
Isn't the fix to make inode_state_read_once() take a const struct inode *?
Re: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
Quoted 8 lines · Christian Brauner
Quoted 7 lines · Andrey Albershteyn
Every filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built
*_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with-EBUSYand let the write paths recognize the special writes done while...
Quoted 17 lines
Quoted 4 lines
include/linux/fsverity.h +4
-0+/** +* fsverity_is_building() - is fs-verity being enabled on the inode +* @inode: inode to check +* include/linux/fsverity.h static inline bool fsverity_active(const struct inode *inode) · line 180
Quoted 10 lines
include/linux/fsverity.h +10
-0+* This checks whether the inode's Merkle tree is currently being built. +* While this is the case the file is read-only to userspace and the only writes +* allowed are for the fs-verity metadata. This becomes false when fsverity +* metadata is fully created and written to disk or building failed. +* +* Return: true if fs-verity is being enabled on the inode +*/ +static inline bool fsverity_is_building (const struct inode *inode) +{ +return inode_state_read_once ((struct inode *)inode) &I_VERITY_BUILDING ;Isn't the fix to make
inode_state_read_once()take a const struct inode *?
Yes I have a fix, I will send as part of this series in the next revision
Signature · 1 line
- Andrey
Christian Brauner
maintainerRe: [PATCH v2 2/5] fsverity: add I_VERITY_BUILDING inode state flag
In reply to Andrey AlbershteynQuoted 16 lines · Andrey Albershteyn
Every filesystem that supports fs-verity keeps a private runtime inode flag meaning Merkle tree is currently being built
*_VERITY_IN_PROGRESS. They all serve the same two purposes: reject a concurrent enable with-EBUSYand let the write paths recognize the special writes done while the tree is under construction.Hoist this flag into the VFS as a new inode state flag,
I_VERITY_BUILDING, and manage its lifetime in the generic fs-verity enable path. The flag is set after ->begin_enable_verity() succeeds and cleared after ->end_enable_verity() returns (both on the success and the rollback paths). Add the concurrent-enable guard.A new helper,
fsverity_is_building(), is provided for filesystems to query the flag. No filesystem uses it yet; the per-fs flags are converted in following patches.
Quoted 5 lines
Signed-off-by Andrey Albershteyn <[email protected]>--- fs/verity/enable.c | 22 +++++++++++++++++++--- include/linux/fs.h | 6 ++++++ include/linux/fsverity.h | 21 +++++++++++++++++++++
fs,fsverity:
as prefix, please.
PATCH v2 3/5 btrfs: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynNow that the VFS tracks an inode whose Merkle tree is under construction via I_VERITY_BUILDING and handles the concurrent-enable guard in the generic fs-verity enable path, drop the inode runtime flags that duplicated this.
btrfs only used BTRFS_INODE_VERITY_IN_PROGRESS internally, so remove it outright.
--- fs/btrfs/btrfs_inode.h | 7 ------- fs/btrfs/verity.c | 14 +++----------- 2 files changed, 3 insertions(+), 18 deletions(-)
fs/btrfs/btrfs_inode.h +0 -7
@@ -78,13 +78,6 @@ enum {* the file range, inode's io_tree). */ BTRFS_INODE_NO_DELALLOC_FLUSH , -/* -* Set when we are working on enabling verity for a file. Computing and -* writing the whole Merkle tree can take a while so we want to prevent -* races where two separate tasks attempt to simultaneously start verity -* on the same file. -*/ -BTRFS_INODE_VERITY_IN_PROGRESS ,/* Set when this inode is a free space inode. */ BTRFS_INODE_FREE_SPACE_INODE,/* Set when there are no capabilities in XATTs for the inode. */
fs/btrfs/verity.c +3 -11
@@ -461,7 +461,6 @@ static int rollback_verity(struct btrfs_inode *inode)btrfs_assert_inode_locked (inode);truncate_inode_pages (inode->vfs_inode.i_mapping, inode->vfs_inode.i_size); -clear_bit (BTRFS_INODE_VERITY_IN_PROGRESS , &inode->runtime_flags); ret =btrfs_drop_verity_items (inode);if (ret) { btrfs_handle_fs_error(root->fs_info, ret,
@@ -513,7 +512,6 @@ static int rollback_verity(struct btrfs_inode *inode)* - mark the inode with the verity flag * - delete the orphan item * - mark the ro compat bit -* - clear the in progress bit * * Returns 0 on success, negative error code on failure. */
@@ -555,7 +553,6 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc, goto end_trans;/* Now that rollback is no longer possible, set S_VERITY. */ btrfs_sync_inode_flags_to_i_flags (inode); -clear_bit (BTRFS_INODE_VERITY_IN_PROGRESS , &inode->runtime_flags);btrfs_set_fs_compat_ro (root->fs_info,VERITY ); end_trans:if (ret)
@@ -570,8 +567,8 @@ static int finish_verity(struct btrfs_inode *inode, const void *desc,* * @filp: file to enable verity on * -* Begin enabling fsverity for the file. We drop any existing verity items, add -* an orphan and set the in progress bit. +* Begin enabling fsverity for the file. We drop any existing verity items and +* add an orphan. * * Returns 0 on success, negative error code on failure. */
@@ -587,9 +584,6 @@ static int btrfs_begin_enable_verity(struct file *filp)if (IS_ENCRYPTED (&inode->vfs_inode))return -EOPNOTSUPP ; -if (test_bit (BTRFS_INODE_VERITY_IN_PROGRESS , &inode->runtime_flags)) -return -EBUSY ; -/* * This should almost never do anything, but theoretically, it's * possible that we failed to enable verity on a file, then were
@@ -606,11 +600,9 @@ static int btrfs_begin_enable_verity(struct file *filp)return PTR_ERR (trans); ret =btrfs_orphan_add (trans, inode); -if (!ret) -set_bit (BTRFS_INODE_VERITY_IN_PROGRESS , &inode->runtime_flags);btrfs_end_transaction (trans); -return 0 ; +return ret; }/*
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [PATCH v2 3/5] btrfs: use I_VERITY_BUILDING instead of private flags
Sashiko has reviewed this patch and found no issues.
Quoted 9 lines
Now that the VFS tracks an inode whose Merkle tree is under construction via
I_VERITY_BUILDINGand handles the concurrent-enable guard in the generic fs-verity enable path, drop the inode runtime flags that duplicated this.btrfs only used
BTRFS_INODE_VERITY_IN_PROGRESSinternally, so remove it outright.Signed-off-by Andrey Albershteyn <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Re: [PATCH v2 3/5] btrfs: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynLooks good:
PATCH v2 4/5 ext4: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynNow that the VFS tracks an inode whose Merkle tree is under construction via I_VERITY_BUILDING and handles the concurrent-enable guard in the generic fs-verity enable path, drop the per-filesystem runtime flags that duplicated this state.
Replace ext4 own helper ext4_verity_in_progress() with fsverity_is_building(), and remove the EXT4_STATE_VERITY_IN_PROGRESS flags. The IS_ENABLED() guard is fine to remove now as fsverity_is_building() has stub for disabled fsverity.
--- fs/ext4/ext4.h | 7 ------- fs/ext4/file.c | 2 +- fs/ext4/inode.c | 17 +++++++++-------- fs/ext4/ioctl.c | 3 +-- fs/ext4/verity.c | 18 +++++------------- 5 files changed, 16 insertions(+), 31 deletions(-)
fs/ext4/ext4.h +0 -7
@@ -2049,7 +2049,6 @@ enum {EXT4_STATE_MAY_INLINE_DATA ,/* may have in-inode data */ EXT4_STATE_EXT_PRECACHED ,/* extents have been precached */ EXT4_STATE_LUSTRE_EA_INODE ,/* Lustre-style ea_inode */ -EXT4_STATE_VERITY_IN_PROGRESS ,/* building fs-verity Merkle tree */ EXT4_STATE_FC_COMMITTING ,/* Fast commit ongoing */ EXT4_STATE_FC_FLUSHING_DATA ,/* Fast commit flushing data */ EXT4_STATE_ORPHAN_FILE, /* Inode orphaned in orphan file */
@@ -2128,12 +2127,6 @@ static inline int ext4_inode_state_wait_bit(int bit)#define EXT4_SB (sb) (sb)#endif -static inline bool ext4_verity_in_progress (struct inode *inode) -{ -return IS_ENABLED (CONFIG_FS_VERITY ) && -ext4_test_inode_state (inode,EXT4_STATE_VERITY_IN_PROGRESS ); -} -#define NEXT_ORPHAN (inode) EXT4_I(inode)->i_dtime/*
fs/ext4/file.c +1 -1
@@ -318,7 +318,7 @@ static ssize_t ext4_write_checks(struct kiocb *iocb, struct iov_iter *from)* partial block that beyond the existing EOF, as it may contains * stale data written through mmap. */ -if (iocb->ki_pos > old_size && !ext4_verity_in_progress (inode)) { +if (iocb->ki_pos > old_size && !fsverity_is_building (inode)) {if (iocb->ki_flags &IOCB_NOWAIT )return -EAGAIN ;
fs/ext4/inode.c +9 -8
@@ -42,6 +42,7 @@#include <linux/bitops.h> #include <linux/iomap.h> #include <linux/iversion.h> +#include <linux/fsverity.h> #include "ext4_jbd2.h" #include "ext4_extents.h"
@@ -511,7 +512,7 @@ void ext4_check_map_extents_env(struct inode *inode)is_special_ino (inode->i_sb, inode->i_ino) || (inode_state_read_once (inode) & (I_FREEING |I_WILL_FREE |I_NEW )) ||ext4_test_inode_flag (inode,EXT4_INODE_EA_INODE ) || - ext4_verity_in_progress(inode)) + fsverity_is_building(inode)) return; WARN_ON_ONCE(!inode_is_locked(inode) &&
@@ -1498,7 +1499,7 @@ static int ext4_write_begin(const struct kiocb *iocb,if (ret) {bool extended = (pos + len > inode->i_size) && - !ext4_verity_in_progress (inode); + !fsverity_is_building (inode);folio_unlock (folio);/*
@@ -1565,7 +1566,7 @@ static int ext4_write_end(const struct kiocb *iocb,loff_t old_size = inode->i_size;int ret =0 , ret2;int i_size_changed =0 ; -bool verity =ext4_verity_in_progress (inode); +bool verity =fsverity_is_building (inode);trace_ext4_write_end (inode, pos, len, copied);
@@ -1670,7 +1671,7 @@ static int ext4_journalled_write_end(const struct kiocb *iocb,int partial =0 ;unsigned from, to;int size_changed =0 ; -bool verity =ext4_verity_in_progress (inode); +bool verity =fsverity_is_building (inode);trace_ext4_journalled_write_end (inode, pos, len, copied); from = pos & (PAGE_SIZE -1 );
@@ -2215,7 +2216,7 @@ static void mpage_submit_folio(struct mpage_da_data *mpd, struct folio *folio) size =i_size_read (mpd->inode); len =folio_size (folio);if (folio_pos (folio) + len > size && - !ext4_verity_in_progress (mpd->inode)) + !fsverity_is_building (mpd->inode)) len = size & (len -1 );ext4_bio_write_folio (&mpd->io_submit, folio, len); }
@@ -2305,7 +2306,7 @@ static int mpage_process_page_bufs(struct mpage_da_data *mpd,ext4_lblk_t blocks = (i_size_read (inode) +i_blocksize (inode) -1 ) >> inode->i_blkbits; -if (ext4_verity_in_progress (inode)) +if (fsverity_is_building (inode)) blocks =EXT_MAX_BLOCKS ; do {
@@ -2711,7 +2712,7 @@ static int mpage_journal_page_buffers(handle_t *handle, mpd->wbc->nr_to_write -=folio_nr_pages (folio);if (folio_pos (folio) + len > size && - !ext4_verity_in_progress (inode)) + !fsverity_is_building (inode)) len = size & (len -1 );return ext4_journal_folio_buffers (handle, folio, len);
@@ -3276,7 +3277,7 @@ static int ext4_da_write_begin(const struct kiocb *iocb, index = pos >>PAGE_SHIFT ; -if (ext4_nonda_switch (inode->i_sb) ||ext4_verity_in_progress (inode)) { +if (ext4_nonda_switch (inode->i_sb) ||fsverity_is_building (inode)) { *fsdata = (void *)FALL_BACK_TO_NONDELALLOC ;return ext4_write_begin (iocb, mapping, pos, len, foliop, fsdata);
fs/ext4/ioctl.c +1 -2
@@ -575,8 +575,7 @@ static bool dax_compatible(struct inode *inode, unsigned int oldflags,if (flags &EXT4_DAX_FL ) {if ((oldflags &EXT4_DAX_MUT_EXCL ) || -ext4_test_inode_state (inode, -EXT4_STATE_VERITY_IN_PROGRESS )) { +fsverity_is_building (inode)) {return false; } }
fs/ext4/verity.c +5 -13
@@ -83,9 +83,6 @@ static int ext4_begin_enable_verity(struct file *filp)if (IS_DAX (inode) ||ext4_test_inode_flag (inode,EXT4_INODE_DAX ))return -EINVAL ; -if (ext4_verity_in_progress (inode)) -return -EBUSY ; -/* * Since the file was opened readonly, we have to initialize the jbd * inode and quotas here and not rely on ->open() doing it. This must
@@ -123,8 +120,6 @@ static int ext4_begin_enable_verity(struct file *filp)return PTR_ERR (handle); err =ext4_orphan_add (handle, inode); -if (err ==0 ) -ext4_set_inode_state (inode,EXT4_STATE_VERITY_IN_PROGRESS );ext4_journal_stop (handle);return err;
@@ -185,10 +180,9 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc, goto cleanup;/* -* Write all pages (both data and verity metadata). Note that this must -* happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages -* beyond i_size won't be written properly. For crash consistency, this -* also must happen before the verity inode flag gets persisted. +* Write all pages (both data and verity metadata). For crash +* consistency, this also must happen before the verity inode flag gets +* persisted. */ err =filemap_write_and_wait (inode->i_mapping);if (err)
@@ -224,7 +218,6 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc,/* Now that rollback is no longer possible, set S_VERITY. */ ext4_set_inode_flags (inode, false); -ext4_clear_inode_state (inode,EXT4_STATE_VERITY_IN_PROGRESS );return 0 ; stop_and_cleanup:
@@ -234,13 +227,12 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc,/* * Verity failed to be enabled, so clean up by truncating any verity * metadata that was written beyond i_size (both from cache and from -* disk), removing the inode from the orphan list (if it wasn't done -* already), and clearing EXT4_STATE_VERITY_IN_PROGRESS. +* disk) and removing the inode from the orphan list (if it wasn't done +* already). */ truncate_inode_pages (inode->i_mapping, inode->i_size);ext4_truncate (inode);ext4_orphan_del (NULL , inode); -ext4_clear_inode_state (inode,EXT4_STATE_VERITY_IN_PROGRESS );return err; }
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [f2fs-dev] [PATCH v2 4/5] ext4: use I_VERITY_BUILDING instead of private flags
Sashiko has reviewed this patch and found no issues.
Quoted 11 lines
Now that the VFS tracks an inode whose Merkle tree is under construction via
I_VERITY_BUILDINGand handles the concurrent-enable guard in the generic fs-verity enable path, drop the per-filesystem runtime flags that duplicated this state.Replace ext4 own helper
ext4_verity_in_progress()withfsverity_is_building(), and remove theEXT4_STATE_VERITY_IN_PROGRESSflags. TheIS_ENABLED()guard is fine to remove now asfsverity_is_building()has stub for disabled fsverity.Signed-off-by Andrey Albershteyn <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH v2 4/5] ext4: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynLooks good:
Eric Biggers
maintainerRe: [PATCH v2 4/5] ext4: use I_VERITY_BUILDING instead of private flags
In reply to Andrey Albershteynfs/ext4/verity.c static int ext4_end_enable_verity(struct file *filp, const void *desc, · line 187
Quoted 10 lines · Andrey Albershteyn
fs/ext4/verity.c +3
-4/* -* Write all pages (both data and verity metadata). Note that this must -* happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages -* beyond i_size won't be written properly. For crash consistency, this -* also must happen before the verity inode flag gets persisted. +* Write all pages (both data and verity metadata). For crash +* consistency, this also must happen before the verity inode flag gets +* persisted. */ err =filemap_write_and_wait (inode->i_mapping);
The deleted sentence (which wasn't deleted properly, as it left the "this also must happen" clause dangling) actually still applies. Just it should be updated to use the new flag name, or else refer to ->end_enable_verity() returning instead.
- Eric
PATCH v2 5/5 f2fs: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynNow that the VFS tracks an inode whose Merkle tree is under construction via I_VERITY_BUILDING and handles the concurrent-enable guard in the generic fs-verity enable path, drop the inode runtime flags that duplicated this state.
Replace f2fs own helper f2fs_verity_in_progress() with fsverity_is_building(), and remove the and FI_VERITY_IN_PROGRESS flags. It's fine to remove IS_ENABLED() guard as fsverity_is_building() has stub.
--- fs/f2fs/data.c | 10 +++++----- fs/f2fs/f2fs.h | 7 ------- fs/f2fs/verity.c | 15 ++++----------- 3 files changed, 9 insertions(+), 23 deletions(-)
fs/f2fs/data.c +5 -5
@@ -3356,7 +3356,7 @@ int f2fs_write_single_data_page(struct folio *folio, int *submitted, goto redirty_out;if (folio->index < end_index || -f2fs_verity_in_progress (inode) || +fsverity_is_building (inode) || compr_blocks) goto write;
@@ -3889,7 +3889,7 @@ void f2fs_write_failed(struct inode *inode, loff_t to)return ;/* In the fs-verity case, f2fs_end_enable_verity() does the truncate */ -if (to > i_size && !f2fs_verity_in_progress (inode)) { +if (to > i_size && !fsverity_is_building (inode)) {f2fs_down_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]);filemap_invalidate_lock (inode->i_mapping);
@@ -4205,7 +4205,7 @@ static int f2fs_write_begin(const struct kiocb *iocb,return 0 ;if (!(pos & (PAGE_SIZE -1 )) && (pos + len) >=i_size_read (inode) && - !f2fs_verity_in_progress (inode)) { + !fsverity_is_building (inode)) {folio_zero_segment (folio, len,folio_size (folio));return 0 ; }
@@ -4279,7 +4279,7 @@ static int f2fs_write_end(const struct kiocb *iocb,f2fs_update_time (F2FS_I_SB (inode),REQ_TIME );if (pos + copied >i_size_read (inode) && - !f2fs_verity_in_progress (inode)) + !fsverity_is_building (inode))f2fs_i_size_write (inode, pos + copied);return copied; }
@@ -4294,7 +4294,7 @@ static int f2fs_write_end(const struct kiocb *iocb,folio_set_f2fs_atomic (folio);if (pos + copied >i_size_read (inode) && - !f2fs_verity_in_progress (inode)) { + !fsverity_is_building (inode)) {f2fs_i_size_write (inode, pos + copied);if (f2fs_is_atomic_file (inode)) f2fs_i_size_write(F2FS_I(inode)->cow_inode,
fs/f2fs/f2fs.h +0 -7
@@ -925,7 +925,6 @@ enum {FI_EXTRA_ATTR ,/* indicate file has extra attribute */ FI_PROJ_INHERIT ,/* indicate file inherits projectid */ FI_PIN_FILE ,/* indicate file should not be gced */ -FI_VERITY_IN_PROGRESS ,/* building fs-verity Merkle tree */ FI_COMPRESSED_FILE ,/* indicate file's data can be compressed */ FI_COMPRESS_CORRUPT ,/* indicate compressed cluster is corrupted */ FI_MMAP_FILE, /* indicate file was mmapped */
@@ -3535,12 +3534,6 @@ static inline void clear_inode_flag(struct inode *inode, int flag)__mark_inode_dirty_flag (inode, flag, false); } -static inline bool f2fs_verity_in_progress (struct inode *inode) -{ -return IS_ENABLED (CONFIG_FS_VERITY ) && -is_inode_flag_set (inode,FI_VERITY_IN_PROGRESS ); -} -static inline void set_acl_inode (struct inode *inode,umode_t mode) {F2FS_I (inode)->i_acl_mode = mode;
fs/f2fs/verity.c +4 -11
@@ -94,9 +94,6 @@ static int f2fs_begin_enable_verity(struct file *filp)struct inode *inode =file_inode (filp);int err; -if (f2fs_verity_in_progress (inode)) -return -EBUSY ; -if (f2fs_is_atomic_file (inode))return -EOPNOTSUPP ;
@@ -113,7 +110,6 @@ static int f2fs_begin_enable_verity(struct file *filp)if (err)return err; -set_inode_flag (inode,FI_VERITY_IN_PROGRESS );return 0 ; }
@@ -143,10 +139,9 @@ static int f2fs_end_enable_verity(struct file *filp, const void *desc, goto cleanup;/* -* Write all pages (both data and verity metadata). Note that this must -* happen before clearing FI_VERITY_IN_PROGRESS; otherwise pages beyond -* i_size won't be written properly. For crash consistency, this also -* must happen before the verity inode flag gets persisted. +* Write all pages (both data and verity metadata). For crash +* consistency, this also must happen before the verity inode flag gets +* persisted. */ err =filemap_write_and_wait (inode->i_mapping);if (err)
@@ -164,14 +159,13 @@ static int f2fs_end_enable_verity(struct file *filp, const void *desc,f2fs_set_inode_flags (inode);f2fs_mark_inode_dirty_sync (inode, true); -clear_inode_flag (inode,FI_VERITY_IN_PROGRESS );return 0 ; cleanup:/* * Verity failed to be enabled, so clean up by truncating any verity * metadata that was written beyond i_size (both from cache and from -* disk) and clearing FI_VERITY_IN_PROGRESS. +* disk). * * Taking i_gc_rwsem[WRITE] is needed to stop f2fs garbage collection * from re-instantiating cached pages we are truncating (since unlike
@@ -186,7 +180,6 @@ static int f2fs_end_enable_verity(struct file *filp, const void *desc,set_sbi_flag (sbi,SBI_NEED_FSCK ); }f2fs_up_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]); -clear_inode_flag (inode,FI_VERITY_IN_PROGRESS );return err ?: err2; }
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [f2fs-dev] [PATCH v2 5/5] f2fs: use I_VERITY_BUILDING instead of private flags
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] f2fs: unconverted f2fs_verity_in_progress() calls break build in data.c --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] f2fs: unconverted f2fs_verity_in_progress() calls break build in data.c --
commit e644391a5127c3435bf66450e53975dc1299ff60
Author: Andrey Albershteyn <[email protected]>
f2fs: use I_VERITY_BUILDING instead of private flags
This commit removes the f2fs-private FI_VERITY_IN_PROGRESS inode flag and the f2fs_verity_in_progress() helper in favor of the VFS I_VERITY_BUILDING flag and fsverity_is_building().
Quoted 13 lines
fs/f2fs/f2fs.h +0
-1@@ -925,7 +925,6 @@ enum {FI_EXTRA_ATTR ,/* indicate file has extra attribute */ FI_PROJ_INHERIT ,/* indicate file inherits projectid */ FI_PIN_FILE ,/* indicate file should not be gced */ -FI_VERITY_IN_PROGRESS ,/* building fs-verity Merkle tree */ FI_COMPRESSED_FILE ,/* indicate file's data can be compressed */ FI_COMPRESS_CORRUPT ,/* indicate compressed cluster is corrupted */ FI_MMAP_FILE, /* indicate file was mmapped */
fs/f2fs/f2fs.h static inline void clear_inode_flag(struct inode *inode, int flag) · line 3634
Quoted 8 lines
fs/f2fs/f2fs.h +0
-5@@ -3627,12 +3626,6 @@ static inline void clear_inode_flag(struct inode *inode, int flag)__mark_inode_dirty_flag (inode, flag, false); } -static inline bool f2fs_verity_in_progress (struct inode *inode) -{ -return IS_ENABLED (CONFIG_FS_VERITY ) && -is_inode_flag_set (inode,FI_VERITY_IN_PROGRESS ); -}
[Severity: Low]
As reported by Sashiko on v1 [1], does removing f2fs_verity_in_progress() break the build in fs/f2fs/data.c when CONFIG_F2FS_FS is enabled?
Two callers in the large-folio write paths in fs/f2fs/data.c still call f2fs_verity_in_progress(inode):
fs/f2fs/data.c:f2fs_write_cache_folios() {
...
retry:
pos = folio_pos(folio);
end_pos = pos + folio_size(folio);
isize = i_size_read(inode);
verity_in_progress = f2fs_verity_in_progress(inode);
poff = 0;
...
}and:
fs/f2fs/data.c:prepare_large_folio_write_begin() {
...
if (!f2fs_verity_in_progress(inode) &&
!(pos & (PAGE_SIZE - 1)) && (pos + len) >= i_size_read(inode)) {
...
}Should these two callers also be updated to use fsverity_is_building(inode)?
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Re: [PATCH v2 5/5] f2fs: use I_VERITY_BUILDING instead of private flags
In reply to Andrey AlbershteynThis looks good to me, but given the conflict with the f2fs tree maybe delay this until after the current merge window?
Eric Biggers
maintainerRe: [PATCH v2 5/5] f2fs: use I_VERITY_BUILDING instead of private flags
In reply to Andrey Albershteynfs/f2fs/verity.c static int f2fs_end_enable_verity(struct file *filp, const void *desc, · line 145
Quoted 9 lines · Andrey Albershteyn
fs/f2fs/verity.c +3
-4/* -* Write all pages (both data and verity metadata). Note that this must -* happen before clearing FI_VERITY_IN_PROGRESS; otherwise pages beyond -* i_size won't be written properly. For crash consistency, this also -* must happen before the verity inode flag gets persisted. +* Write all pages (both data and verity metadata). For crash +* consistency, this also must happen before the verity inode flag gets +* persisted. */
Same as ext4 patch: the deleted sentence (which wasn't deleted properly, as it left the "this also must happen" clause dangling) actually still applies. Just it should be updated to use the new flag name, or else refer to ->end_enable_verity() returning instead.
- Eric