Re: [[email protected]: [PATCH v7 03/22] ovl: use core fsverity ensure info interface]
Amir Goldstein <[email protected]>
| Newsgroups | org.kernel.vger.linux-unionfs |
|---|---|
| Message-ID | <CAOQ4uxj558yzeFtbVbK-OZ_isWOEJ5fbD2odh4MkA4Od-ga6-A@mail.gmail.com> |
On Fri, Apr 10, 2026 at 1:10 PM Andrey Albershteyn <[email protected]> wrote: > > Forgot to add overlayfs as a receiver, this is overlayfs relevant > patch in the patchset adding fsverity support for XFS [1]. > > The patchset exposes fsverity_ensure_verity_info() [2] which could be > used instead. > > 1: https://lore.kernel.org/linux-fsdevel/[email protected]/T/#t > 2: https://lore.kernel.org/linux-fsdevel/[email protected]/T/#m6baa3210a16a2f54ce977353da7532a93f1aef65 > > ----- Forwarded message from Andrey Albershteyn <[email protected]> ----- > > Subject: [PATCH v7 03/22] ovl: use core fsverity ensure info interface > From: Andrey Albershteyn <[email protected]> > Date: Thu, 9 Apr 2026 15:13:35 +0200 > To: [email protected], [email protected], > [email protected], [email protected] > Cc: Andrey Albershteyn <[email protected]>, [email protected], > [email protected], [email protected], > [email protected], [email protected] > Message-ID: <[email protected]> > In-Reply-To: <[email protected]> > > fsverity now exposes fsverity_ensure_verity_info() which could be used > instead of opening file to ensure that fsverity info is loaded and > attached to inode. > > Signed-off-by: Andrey Albershteyn <[email protected]> Looks nice Acked-by: Amir Goldstein <[email protected]> > --- > fs/overlayfs/util.c | 14 +++----------- > 1 file changed, 3 insertions(+), 11 deletions(-) > > diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c > index 2ea769f311c3..8bde5dc31d7d 100644 > --- a/fs/overlayfs/util.c > +++ b/fs/overlayfs/util.c > @@ -16,6 +16,7 @@ > #include <linux/namei.h> > #include <linux/ratelimit.h> > #include <linux/overflow.h> > +#include <linux/fsverity.h> > #include "overlayfs.h" > > /* Get write access to upper mnt - may fail if upper sb was remounted ro */ > @@ -1377,18 +1378,9 @@ char *ovl_get_redirect_xattr(struct ovl_fs *ofs, const struct path *path, int pa > int ovl_ensure_verity_loaded(const struct path *datapath) > { > struct inode *inode = d_inode(datapath->dentry); > - struct file *filp; > > - 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); > > return 0; > } > -- > 2.51.2 > > > > ----- End forwarded message ----- > > -- > - Andrey > >