public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bruce Fields <bfields@fieldses.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Ondrej Valousek <ondrej.valousek.xm@renesas.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [GIT PULL] nfsd changes for 5.18
Date: Mon, 11 Jul 2022 14:36:03 -0400	[thread overview]
Message-ID: <20220711183603.GD14184@fieldses.org> (raw)
In-Reply-To: <7CD95BBD-3552-47BD-ACF6-EC51F62787E1@oracle.com>

On Mon, Jul 11, 2022 at 06:24:01PM +0000, Chuck Lever III wrote:
> 
> 
> > On Jul 11, 2022, at 2:19 PM, Bruce Fields <bfields@fieldses.org> wrote:
> > 
> > On Mon, Jul 11, 2022 at 06:33:04AM -0400, Jeff Layton wrote:
> >> On Sun, 2022-07-10 at 16:42 +0000, Chuck Lever III wrote:
> >>>> This patch regressed clients that support TIME_CREATE attribute.
> >>>> Starting with this patch client might think that server supports
> >>>> TIME_CREATE and start sending this attribute in its requests.
> >>> 
> >>> Indeed, e377a3e698fb ("nfsd: Add support for the birth time
> >>> attribute") does not include a change to nfsd4_decode_fattr4()
> >>> that decodes the birth time attribute.
> >>> 
> >>> I don't immediately see another storage protocol stack in our
> >>> kernel that supports a client setting the birth time, so NFSD
> >>> might have to ignore the client-provided value.
> >>> 
> >> 
> >> Cephfs allows this. My thinking at the time that I implemented it was
> >> that it should be settable for backup purposes, but this was possibly a
> >> mistake. On most filesystems, the btime seems to be equivalent to inode
> >> creation time and is read-only.
> > 
> > So supporting it as read-only seems reasonable.
> > 
> > Clearly, failing to decode the setattr attempt isn't the right way to do
> > that.  I'm not sure what exactly it should be doing--some kind of
> > permission error on any setattr containing TIME_CREATE?
> 
> I don't think that will work.
> 
> NFSD now asserts FATTR4_WORD1_TIME_CREATE when clients ask for
> the mask of attributes it supports. That means the server has
> to process GETATTR and SETATTR (and OPEN) operations that
> contain FATTR4_WORD1_TIME_CREATE as not an error.

Well, permissions or bad attribute values or other stuff may prevent
setting one of the attributes.

And setattr isn't guaranteed to be atomic, so I don't think you can
eliminate the possibility that part of it might succeed and part might
not.

But it might be more helpful to fail the whole thing up front if you
know part of it's going to fail?

> The protocol
> allows the server to indicate it ignored the time_create value
> by clearing the FATTR4_WORD1_TIME_CREATE bit in the attribute
> bitmask it returns in the reply.

Yes, I think you also return an error in that case, though.

--b.

  reply	other threads:[~2022-07-11 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 14:12 [GIT PULL] nfsd changes for 5.18 Chuck Lever III
2022-03-22 18:32 ` pr-tracker-bot
2022-07-10 10:43 ` Igor Mammedov
2022-07-10 16:42   ` Chuck Lever III
2022-07-11 10:33     ` Jeff Layton
2022-07-11 18:19       ` Bruce Fields
2022-07-11 18:24         ` Chuck Lever III
2022-07-11 18:36           ` Bruce Fields [this message]
2022-07-11 18:56             ` Jeff Layton
2022-07-12 12:57               ` Bruce Fields
2022-07-12  8:27         ` Igor Mammedov
2022-07-12 11:42           ` Bruce Fields
2022-07-13  8:17             ` Igor Mammedov

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=20220711183603.GD14184@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=imammedo@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ondrej.valousek.xm@renesas.com \
    --cc=torvalds@linux-foundation.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