From: Trond Myklebust <trondmy@hammerspace.com>
To: "njha@janestreet.com" <njha@janestreet.com>,
"bcodding@redhat.com" <bcodding@redhat.com>
Cc: "anna@kernel.org" <anna@kernel.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nfs: propagate fileid changed errors back to syscall
Date: Tue, 10 Dec 2024 17:33:14 +0000 [thread overview]
Message-ID: <16e5f609599e29b49c81a1a8edd721a5daabc1bb.camel@hammerspace.com> (raw)
In-Reply-To: <20241210A1712306692debd.njha@janestreet.com>
On Tue, 2024-12-10 at 12:12 -0500, Nikhil Jha wrote:
> On Tue, Dec 10, 2024 at 07:11:43AM -0500, Benjamin Coddington wrote:
> > On 9 Dec 2024, at 12:39, Nikhil Jha wrote:
> >
> > > Hello! This is the first kernel patch I have tried to upstream.
> > > I'm
> > > following along with the kernel newbies guide but apologies if I
> > > got
> > > anything wrong.
> > >
> > > Currently, if there is a mismatch in the request and response
> > > fileids in
> > > an NFS request, the kernel logs an error and attempts to return
> > > ESTALE.
> > > However, this error is currently dropped before it makes it all
> > > the way
> > > to userspace. This appears to be a mistake, since as far as I can
> > > tell
> > > that ESTALE value is never consumed from anywhere.
> > >
> > > Callstack for async NFS write, at time of error:
> > >
> > > nfs_update_inode <- returns -ESTALE
> > > nfs_refresh_inode_locked
> > > nfs_writeback_update_inode <- error is dropped here
> > > nfs3_write_done
> > > nfs_writeback_done
> > > nfs_pgio_result <- other errors are collected here
> > > rpc_exit_task
> > > __rpc_execute
> > > rpc_async_schedule
> > > process_one_work
> > > worker_thread
> > > kthread
> > > ret_from_fork
> > >
> > > We ran into this issue ourselves, and seeing the -ESTALE in the
> > > kernel
> > > source code but not from userspace was surprising.
> > >
> > > I tested a rebased version of this patch on an el8 kernel
> > > (v6.1.114),
> > > and it seems to correctly propagate this error.
> > >
> > > > 8------------------------------------------------------8<
> > >
> > > If an NFS server returns a response with a different file id to
> > > the
> > > response, the kernel currently prints out an error and attempts
> > > to
> > > return -ESTALE. However, this -ESTALE value is never surfaced
> > > anywhere.
> >
> > Hi Nikhil Jha,
> >
> > Will this cause us to return -ESTALE to the application even if the
> > WRITE
> > was successful?
> >
> > Ben
> >
>
> Hi Ben,
>
> Hmm.. I'm not sure how to answer that question exactly. A fileid is
> only
> mismatched between a request RPC and response RPC when something
> really
> weird is going on (i.e. a bug in the NFS server), so it's hard to
> reason
> about if a WRITE was successful or not.
>
> The `return -ESTALE` was already in the kernel code, but this
> particular
> codepath seems to have accidentally dropped that error.
>
> Nikhil
>
I'm not keen on taking any client changes to paper over what appears to
be a major server bug. We simply can't support broken servers that
reuse filehandles across files.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2024-12-10 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 17:39 Nikhil Jha
2024-12-10 12:11 ` Benjamin Coddington
2024-12-10 17:12 ` Nikhil Jha
2024-12-10 17:33 ` Trond Myklebust [this message]
2024-12-10 17:46 ` Nikhil Jha
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=16e5f609599e29b49c81a1a8edd721a5daabc1bb.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna@kernel.org \
--cc=bcodding@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=njha@janestreet.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
all inboxes | Powered by JetHome®