From: Jeff Layton <jlayton@kernel.org>
To: NeilBrown <neilb@suse.de>
Cc: Chuck Lever <chuck.lever@oracle.com>,
Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Boyang Xue <bxue@redhat.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/2] nfsd: sanely handle inabilty to fetch pre/post attributes
Date: Mon, 24 Jul 2023 06:36:57 -0400 [thread overview]
Message-ID: <963cc8896ff6a6759c57f1d97e51f35972d4fc6d.camel@kernel.org> (raw)
In-Reply-To: <168998604179.11078.18238251274062077853@noble.neil.brown.name>
On Sat, 2023-07-22 at 10:34 +1000, NeilBrown wrote:
> On Fri, 21 Jul 2023, Jeff Layton wrote:
> > On Fri, 2023-07-21 at 07:42 +1000, NeilBrown wrote:
> > >
> > > I think both v3 and v4 allow a reply that says "the operation was a
> > > success but there are no post-op attrs". With v4 you can say "there is
> > > no change-attr, but here are some other attrs". I think.
> > >
> >
> > v3 has this ability:
> >
> > union pre_op_attr switch (bool attributes_follow) {
> > case TRUE:
> > wcc_attr attributes;
> > case FALSE:
> > void;
> > };
> >
> > ...we can just set the attributes_follow flag to false there in that
> > case.
> >
> > That's not possible with v4, AFAICT. Several of the *4resok structures
> > contain a change_info4, which just looks like this:
> >
> > struct change_info4 {
> > bool atomic;
> > changeid4 before;
> > changeid4 after;
> > };
>
> Yes... I was thinking of GETATTR which reports a bitmap of all the
> attributes that it can return. Though I'm not sure if the server is
> "allowed" to not return something that it has said is "supported". And
> I think changeid has to be "supported". I'm not sure.
>
> But anyway, that doesn't help change_info4 which comes with
> directory-modifying operation.
>
> >
> > We can set "atomic" to false (and this patch does that in this
> > situation), but I don't believe there is any alternative to the change
> > attribute. If the underlying fs doesn't support native change attrs, the
> > server is expected to fake one up somehow (usually from the ctime).
>
> I had a look again at the current code and your patch, and I think that
> if the "post' vfs_getattr() fails, then the operation succeeds, the
> change_info is marked non-atomic (as you say) and the "after" changeid is
> set to an uninitialised value. Is that right? Did I miss something?
> Maybe we should set it to the pre value plus 1.
>
> It probably doesn't matter at all in practice, but if I'm right and it
> is using an uninitialized value, we should at least fix that.
>
> Thanks - your v3 patch looks good in general. I like the must_check and
> the goto structure.
>
> Thanks,
> NeilBrown
>
>
The current patch sets the missing pre/post values to 0. I'm happy to
change that to pre-value+1 though if you think that'd be more correct.
The client already fudges the changeid like that in the CB_GETATTR case,
so I doubt that would break anything.
--
Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2023-07-24 10:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 18:23 [PATCH v2 0/2] nfsd: sanely handle inabilty to fetch pre/post attributes Jeff Layton
2023-07-20 18:23 ` [PATCH v2 1/2] nfsd: handle failure to collect pre/post-op attrs more sanely Jeff Layton
2023-07-20 21:46 ` NeilBrown
2023-07-20 23:09 ` Chuck Lever
2023-07-21 12:17 ` Jeff Layton
2023-07-20 18:23 ` [PATCH v2 2/2] nfsd: remove unsafe BUG_ON from set_change_info Jeff Layton
2023-07-20 21:42 ` [PATCH v2 0/2] nfsd: sanely handle inabilty to fetch pre/post attributes NeilBrown
2023-07-20 23:15 ` Chuck Lever
2023-07-21 12:48 ` Jeff Layton
2023-07-22 0:34 ` NeilBrown
2023-07-24 10:36 ` Jeff Layton [this message]
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=963cc8896ff6a6759c57f1d97e51f35972d4fc6d.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=bxue@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=kolga@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.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).