Re: [PATCH v7 03/22] ovl: use core fsverity ensure info interface

Christoph Hellwig <[email protected]> Tue, 14 Apr 2026 10:13:01 +0200
Newsgroups dev.linux.lists.fsverity,net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
On Thu, Apr 09, 2026 at 03:13:35PM +0200, Andrey Albershteyn wrote:
> -	if (!fsverity_active(inode) && IS_VERITY(inode)) {
> -		/*
> -		 * If this inode was not yet opened, the verity info hasn't been
> -		 * loaded yet, so we need to do that here to force it into memory.
> -		 */
> -		filp = kernel_file_open(datapath, O_RDONLY, current_cred());
> -		if (IS_ERR(filp))
> -			return PTR_ERR(filp);
> -		fput(filp);
> -	}
> +	if (fsverity_active(inode))
> +		fsverity_ensure_verity_info(inode);

fsverity_ensure_verity_info already is a no-op for !fsverity_active,
so the check could be remove.  Also we should probably propagate the
error return from fsverity_ensure_verity_info here.