lkml.org 
[lkml]   [2020]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature
> > @@ -414,7 +415,7 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
> > * Return 0 on match, -ESTALE on mismatch, < 0 on error.
> > */
> > static int ovl_verify_fh(struct dentry *dentry, const char *name,
> > - const struct ovl_fh *fh)
> > + const struct ovl_fh *fh, bool nouuid)
> > {
> > struct ovl_fh *ofh = ovl_get_fh(dentry, name);
> > int err = 0;
> > @@ -425,8 +426,14 @@ static int ovl_verify_fh(struct dentry *dentry, const char *name,
> > if (IS_ERR(ofh))
> > return PTR_ERR(ofh);
> >
> > - if (fh->fb.len != ofh->fb.len || memcmp(&fh->fb, &ofh->fb, fh->fb.len))
> > + if (fh->fb.len != ofh->fb.len) {
> > err = -ESTALE;
> > + } else {
> > + if (nouuid && !uuid_equal(&fh->fb.uuid, &ofh->fb.uuid))
> > + ofh->fb.uuid = fh->fb.uuid;
> > + if (memcmp(&fh->fb, &ofh->fb, fh->fb.len))
> > + err = -ESTALE;
> > + }
> >

On second thought I am wondering if we should do that differently.
If users want to work with index=nouuid, they need to work with it from day 1.
index=nouuid should export null uuid in NFS handles and write null uuid
in trusted.overlay.origin xattr.

So in ovl_encode_real_fh() you set null uuid and
instead of relaxing uuid_equal() in ovl_decode_real_fh()
you change it to uuid_is_null().

Do you have a problem with that for Virtuozzo use case?

Thanks,
Amir.

\
 
 \ /
  Last update: 2020-09-23 18:37    [W:0.084 / U:3.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site