From: Jeff Layton <jlayton@kernel.org>
To: dai.ngo@oracle.com, Chuck Lever III <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v5 3/3] locks: allow support for write delegation
Date: Wed, 24 May 2023 15:03:26 -0400 [thread overview]
Message-ID: <dc0c053d734dc5b45475cde015d1cebb78922336.camel@kernel.org> (raw)
In-Reply-To: <b4c4d608-80aa-7f3d-7a83-2e7b24918b02@oracle.com>
On Wed, 2023-05-24 at 11:05 -0700, dai.ngo@oracle.com wrote:
> On 5/24/23 10:41 AM, Chuck Lever III wrote:
> >
> > > On May 24, 2023, at 12:55 PM, Jeff Layton <jlayton@kernel.org> wrote:
> > >
> > > On Wed, 2023-05-24 at 15:09 +0000, Chuck Lever III wrote:
> > > > > On May 24, 2023, at 11:08 AM, Jeff Layton <jlayton@kernel.org> wrote:
> > > > >
> > > > > On Mon, 2023-05-22 at 16:52 -0700, Dai Ngo wrote:
> > > > > > Remove the check for F_WRLCK in generic_add_lease to allow file_lock
> > > > > > to be used for write delegation.
> > > > > >
> > > > > > First consumer is NFSD.
> > > > > >
> > > > > > Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> > > > > > ---
> > > > > > fs/locks.c | 7 -------
> > > > > > 1 file changed, 7 deletions(-)
> > > > > >
> > > > > > diff --git a/fs/locks.c b/fs/locks.c
> > > > > > index df8b26a42524..08fb0b4fd4f8 100644
> > > > > > --- a/fs/locks.c
> > > > > > +++ b/fs/locks.c
> > > > > > @@ -1729,13 +1729,6 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr
> > > > > > if (is_deleg && !inode_trylock(inode))
> > > > > > return -EAGAIN;
> > > > > >
> > > > > > - if (is_deleg && arg == F_WRLCK) {
> > > > > > - /* Write delegations are not currently supported: */
> > > > > > - inode_unlock(inode);
> > > > > > - WARN_ON_ONCE(1);
> > > > > > - return -EINVAL;
> > > > > > - }
> > > > > > -
> > > > > > percpu_down_read(&file_rwsem);
> > > > > > spin_lock(&ctx->flc_lock);
> > > > > > time_out_leases(inode, &dispose);
> > > > > I'd probably move this back to the first patch in the series.
> > > > >
> > > > > Reviewed-by: Jeff Layton <jlayton@kernel.org>
> > > > I asked him to move it to the end. Is it safe to take out this
> > > > check before write delegation is actually implemented?
> > > >
> > > I think so, but it don't think it doesn't make much difference either
> > > way. The only real downside of putting it at the end is that you might
> > > have to contend with a WARN_ON_ONCE if you're bisecting.
> > My main concern is in fact preventing problems during bisection.
> > I can apply 3/3 and then 1/3, if you're good with that.
>
> I'm good with that. You can apply 3/3 then 1/3 and drop 2/3 so I
> don't have to send out v6.
>
I'm fine with that too, particularly if other vendors don't recall on a
getattr currently.
I wonder though, if we need some clarification in the spec on
CB_GETATTR?
https://www.rfc-editor.org/rfc/rfc8881.html#section-10.4.3
In that section, there is a big distinction about the client being able
to tell that the data was modified from the point where the delegation
was handed out.
There is always a point in time where a client has buffered writes that
haven't been flushed to the server yet, but that's true when it doesn't
have a delegation too. Mostly the client tries to start some writeback
fairly quickly so any lag how the in the change attr/size update is
usually short lived.
I don't think the Linux client materially changes its writeback behavior
based on a write delegation, so I guess (as Olga pointed out) the main
benefit from a write delegation is being able to do delegated opens for
write. A getattr's results won't be changed by extra opens or closes, so
yeah...I guess the utility of CB_GETATTR is really limited.
I guess it _might_ be useful in the case where the server has handed out
a write delegation, but hasn't gotten any writes. That would at least
tell the client that something has changed, even if the deleg holder
hasn't gotten around to writing anything back yet. The problem is that
it's common for applications to open O_RDWR and only do reads.
Maybe we ought to take this discussion to the IETF list? It seems like
the spec mandates that you must recall the delegation if you don't
implement CB_GETATTR, but I don't see much in way of harm in ignoring
that.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2023-05-24 19:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 23:52 [PATCH v5 0/3] NFSD: add support for NFSv4 write delegation Dai Ngo
2023-05-22 23:52 ` [PATCH v5 1/3] NFSD: enable support for " Dai Ngo
2023-05-24 15:08 ` Jeff Layton
2023-05-22 23:52 ` [PATCH v5 2/3] NFSD: handle GETATTR conflict with " Dai Ngo
2023-05-23 2:43 ` Chuck Lever
2023-05-23 6:02 ` dai.ngo
2023-05-24 17:51 ` Chuck Lever III
2023-05-24 15:07 ` Jeff Layton
2023-05-24 17:49 ` dai.ngo
2023-05-25 17:21 ` Chuck Lever III
2023-05-22 23:52 ` [PATCH v5 3/3] locks: allow support for " Dai Ngo
2023-05-24 15:08 ` Jeff Layton
2023-05-24 15:09 ` Chuck Lever III
2023-05-24 16:55 ` Jeff Layton
2023-05-24 17:41 ` Chuck Lever III
2023-05-24 18:05 ` dai.ngo
2023-05-24 19:03 ` Jeff Layton [this message]
2023-05-24 20:27 ` dai.ngo
2023-05-24 17:52 ` dai.ngo
2023-06-12 16:14 ` [PATCH v5 0/3] NFSD: add support for NFSv4 " Chuck Lever III
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=dc0c053d734dc5b45475cde015d1cebb78922336.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.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;
as well as URLs for NNTP newsgroup(s).