Re: [PATCH v3 09/13] fs/verity: use accessors

Eric Biggers
2025-07-22T20:25:34Z

On Tue, Jul 22, 2025 at 09:27:27PM +0200, Christian Brauner wrote:
> static inline void fsverity_cleanup_inode(struct inode *inode)
> {
> - if (inode->i_verity_info)
> + if (inode->i_verity_info || inode->i_sb->s_op->i_fsverity)
> __fsverity_cleanup_inode(inode);

Similarly to fscrypt_put_encryption_info(): I think this should look
like:

if (IS_VERITY(inode))
__fsverity_cleanup_inode(inode);

i_verity_info != NULL implies IS_VERITY(), so that would work and avoid
adding extra dereferences to non-verity files.

The converse isn't necessarily true, but that's okay as long as
__fsverity_cleanup_inode() handles i_verity_info == NULL.

- Eric