On Mon, Jan 26, 2026 at 05:51:02AM +0100, Christoph Hellwig wrote:
> @@ -296,18 +243,39 @@ static inline bool fsverity_verify_page(struct
> fsverity_info *vi,
> * fsverity_active() - do reads from the inode need to go through fs-verity?
> * @inode: inode to check
> *
> - * This checks whether the inode's verity info has been set.
> - *
> - * Filesystems call this from ->readahead() to check whether the pages need
> to
> - * be verified or not. Don't use IS_VERITY() for this purpose; it's subject
> to
> - * a race condition where the file is being read concurrently with
> - * FS_IOC_ENABLE_VERITY completing. (S_VERITY is set before the verity
> info.)
> + * This checks whether the inode's verity info has been set, and reads need
> + * to verify the verity information.
Nit: the point is to verify the file's data, not to verify "the verity
information".
> *
> * Return: true if reads need to go through fs-verity, otherwise false
> */
> -static inline bool fsverity_active(const struct inode *inode)
> +static __always_inline bool fsverity_active(const struct inode *inode)
> +{
> + if (IS_ENABLED(CONFIG_FS_VERITY) && IS_VERITY(inode)) {
> + /*
> + * This pairs with the try_cmpxchg in set_mask_bits()
> + * used to set the S_VERITY bit in i_flags.
> + */
> + smp_mb();
> + return true;
> + }
> +
> + return false;
> +}
Is there a reason for this function in particular to be __always_inline?
fsverity_get_info() is just inline.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel