public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Olga Kornievskaia <aglo@umich.edu>
Cc: Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	 Thomas Haynes <loghyr@gmail.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org
Subject: Re: [PATCH 0/6] nfsd: update the delstid patches for latest draft changes
Date: Fri, 18 Oct 2024 08:05:22 -0400	[thread overview]
Message-ID: <2ed155300b60cb12758322628919c9c631744243.camel@kernel.org> (raw)
In-Reply-To: <CAN-5tyF4=JC4gmFvb2tF-k+15=gzB7-gkW6mHuaA_8Gzr4dSrA@mail.gmail.com>

On Thu, 2024-10-17 at 18:39 -0400, Olga Kornievskaia wrote:
> Seeing strangeness in a network trace with this patch series where
> SETATTR is sent with time_deleg_access and server is returning with
> EINVAL. Test is open() with read delegation, triggering a cb_recall
> via a local access. I can see that the client has changed from sending
> just a delegreturn to sending a setattr+delegreturn. Is there no
> server support and this is normal to return EINVAL.
> 

No, that's a server bug. I think it's this in nfsd4_setattr:

        if (deleg_attrs || (setattr->sa_iattr.ia_valid & ATTR_SIZE)) {
                status = nfs4_preprocess_stateid_op(rqstp, cstate,
                                &cstate->current_fh, &setattr->sa_stateid,
                                WR_STATE, NULL, &st);
                if (status)
                        return status;
        }

We're asking for a WR_STATE in the nfs4_preprocess_stateid_op, but
there isn't one. There is only a read delegation, so we get back
BAD_STATEID and that eventually runs into -EINVAL. I'll need to look
over this and figure out how to fix it properly.

Thanks for the bug report.

> On Mon, Oct 14, 2024 at 3:27 PM Jeff Layton <jlayton@kernel.org> wrote:
> > 
> > This patchset is an update to the delstid patches that went into Chuck's
> > nfsd-next branch recently. The original versions of the spec left out
> > OPEN_DELEGATE_READ_ATTRS_DELEG and OPEN_DELEGATE_WRITE_ATTRS_DELEG. This
> > set adds proper support for them.
> > 
> > My suggestion is to drop these two patches from nfsd-next:
> > 
> >     544c67cc0f26 nfsd: handle delegated timestamps in SETATTR
> >     eee2c04ca5c1 nfsd: add support for delegated timestamps
> > 
> > ...and then apply this set on top of the remaining pile. The resulting
> > set is a bit larger than the original, as I took the liberty of adding
> > some more symbols to the autogenerated part of the spec.
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > Jeff Layton (6):
> >       nfsd: drop inode parameter from nfsd4_change_attribute()
> >       nfsd: switch to autogenerated definitions for open_delegation_type4
> >       nfsd: rename NFS4_SHARE_WANT_* constants to OPEN4_SHARE_ACCESS_WANT_*
> >       nfsd: prepare delegation code for handing out *_ATTRS_DELEG delegations
> >       nfsd: add support for delegated timestamps
> >       nfsd: handle delegated timestamps in SETATTR
> > 
> >  Documentation/sunrpc/xdr/nfs4_1.x    |  22 ++++-
> >  fs/nfsd/nfs4callback.c               |  42 ++++++++-
> >  fs/nfsd/nfs4proc.c                   |  26 ++++-
> >  fs/nfsd/nfs4state.c                  | 178 ++++++++++++++++++++++++++---------
> >  fs/nfsd/nfs4xdr.c                    |  57 ++++++++---
> >  fs/nfsd/nfs4xdr_gen.c                |  19 +++-
> >  fs/nfsd/nfs4xdr_gen.h                |   2 +-
> >  fs/nfsd/nfsd.h                       |   2 +
> >  fs/nfsd/nfsfh.c                      |  11 +--
> >  fs/nfsd/nfsfh.h                      |   3 +-
> >  fs/nfsd/state.h                      |  18 ++++
> >  fs/nfsd/xdr4cb.h                     |  10 +-
> >  include/linux/nfs4.h                 |   2 +-
> >  include/linux/sunrpc/xdrgen/nfs4_1.h |  35 ++++++-
> >  include/linux/time64.h               |   5 +
> >  15 files changed, 348 insertions(+), 84 deletions(-)
> > ---
> > base-commit: 9f8009c5be9367d01cd1627d6a379b4c642d8a28
> > change-id: 20241014-delstid-bf05220ad941
> > 
> > Best regards,
> > --
> > Jeff Layton <jlayton@kernel.org>
> > 
> > 

-- 
Jeff Layton <jlayton@kernel.org>

      reply	other threads:[~2024-10-18 12:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 19:26 [PATCH 0/6] nfsd: update the delstid patches for latest draft changes Jeff Layton
2024-10-14 19:26 ` [PATCH 1/6] nfsd: drop inode parameter from nfsd4_change_attribute() Jeff Layton
2024-10-15 18:29   ` Chuck Lever
2024-10-15 18:42     ` Jeff Layton
2024-10-15 18:50       ` Chuck Lever
2024-10-14 19:26 ` [PATCH 2/6] nfsd: switch to autogenerated definitions for open_delegation_type4 Jeff Layton
2024-10-14 19:26 ` [PATCH 3/6] nfsd: rename NFS4_SHARE_WANT_* constants to OPEN4_SHARE_ACCESS_WANT_* Jeff Layton
2024-10-14 19:26 ` [PATCH 4/6] nfsd: prepare delegation code for handing out *_ATTRS_DELEG delegations Jeff Layton
2024-10-14 19:26 ` [PATCH 5/6] nfsd: add support for delegated timestamps Jeff Layton
2024-11-19  1:01   ` NeilBrown
2024-11-19  1:03     ` Chuck Lever
2024-11-19  1:09       ` Jeff Layton
2024-11-19  1:19         ` Chuck Lever
2024-11-19  1:31     ` Chuck Lever
2024-10-14 19:26 ` [PATCH 6/6] nfsd: handle delegated timestamps in SETATTR Jeff Layton
2024-10-15 19:17 ` [PATCH 0/6] nfsd: update the delstid patches for latest draft changes cel
2024-10-17 22:39 ` Olga Kornievskaia
2024-10-18 12:05   ` 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=2ed155300b60cb12758322628919c9c631744243.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=aglo@umich.edu \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=loghyr@gmail.com \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@kernel.org \
    /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