linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Vivek Goyal <vgoyal@redhat.com>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature
Date: Wed, 23 Sep 2020 19:36:01 +0300	[thread overview]
Message-ID: <CAOQ4uxhjWsK1dfQu4K8uvRyGeGnFrM6opq32RxMOT4pWdqm+3A@mail.gmail.com> (raw)
In-Reply-To: <CAOQ4uxjxYjRkkB3tFqdZiOwj=2_+Ghzf5AvmptVLQM22K5DWfg@mail.gmail.com>

> > @@ -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.

  reply	other threads:[~2020-09-23 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 15:23 [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature Pavel Tikhomirov
2020-09-23 16:09 ` Amir Goldstein
2020-09-23 16:36   ` Amir Goldstein [this message]
2020-09-24  7:40     ` Pavel Tikhomirov
2020-09-24  8:40   ` Pavel Tikhomirov
2020-09-24 10:19     ` Amir Goldstein
2020-09-23 19:47 ` Vivek Goyal
2020-09-24  2:44   ` Amir Goldstein
2020-09-24 13:18     ` Vivek Goyal
2020-09-24 14:33       ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxhjWsK1dfQu4K8uvRyGeGnFrM6opq32RxMOT4pWdqm+3A@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).