All of lore.kernel.org
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: Trond Myklebust <trondmy@gmail.com>
Cc: "J. Bruce Fields" <bfields@redhat.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 0/3] Handling NFSv3 I/O errors in knfsd
Date: Mon, 26 Aug 2019 16:51:56 -0400	[thread overview]
Message-ID: <20190826205156.GA27834@fieldses.org> (raw)
In-Reply-To: <20190826165021.81075-1-trond.myklebust@hammerspace.com>

On Mon, Aug 26, 2019 at 12:50:18PM -0400, Trond Myklebust wrote:
> Recently, a number of changes went into the kernel to try to ensure
> that I/O errors (specifically write errors) are reported to the
> application once and only once. The vehicle for ensuring the errors
> are reported is the struct file, which uses the 'f_wb_err' field to
> track which errors have been reported.
> 
> The problem is that errors are mainly intended to be reported through
> fsync(). If the client is doing synchronous writes, then all is well,
> but if it is doing unstable writes, then the errors may not be
> reported until the client calls COMMIT. If the file cache has
> thrown out the struct file, due to memory pressure, or just because
> the client took a long while between the last WRITE and the COMMIT,
> then the error report may be lost, and the client may just think
> its data is safely stored.

These were lost before the file caching patches as well, right?  Or is
there some regression? 

> Note that the problem is compounded by the fact that NFSv3 is stateless,
> so the server never knows that the client may have rebooted, so there
> can be no guarantee that a COMMIT will ever be sent.
> 
> The following patch set attempts to remedy the situation using 2
> strategies:
> 
> 1) If the inode is dirty, then avoid garbage collecting the file
>    from the file cache.
> 2) If the file is closed, and we see that it would have reported
>    an error to COMMIT, then we bump the boot verifier in order to
>    ensure the client retransmits all its writes.

Sounds sensible to me.

> Note that if multiple clients were writing to the same file, then
> we probably want to bump the boot verifier anyway, since only one
> COMMIT will see the error report (because the cached file is also
> shared).

I'm confused by the "probably should".  So that's future work?  I guess
it'd mean some additional work to identify that case.  You can't really
even distinguish clients in the NFSv3 case, but I suppose you could use
IP address or TCP connection as an approximation.

--b.

> So in order to implement the above strategy, we first have to do
> the following: split up the file cache to act per net namespace,
> since the boot verifier is per net namespace. Then add a helper
> to update the boot verifier.
> 
> Trond Myklebust (3):
>   nfsd: nfsd_file cache entries should be per net namespace
>   nfsd: Support the server resetting the boot verifier
>   nfsd: Don't garbage collect files that might contain write errors
> 
>  fs/nfsd/export.c    |  2 +-
>  fs/nfsd/filecache.c | 76 +++++++++++++++++++++++++++++++++++++--------
>  fs/nfsd/filecache.h |  3 +-
>  fs/nfsd/netns.h     |  4 +++
>  fs/nfsd/nfs3xdr.c   | 13 +++++---
>  fs/nfsd/nfs4proc.c  | 14 +++------
>  fs/nfsd/nfsctl.c    |  1 +
>  fs/nfsd/nfssvc.c    | 32 ++++++++++++++++++-
>  8 files changed, 115 insertions(+), 30 deletions(-)
> 
> -- 
> 2.21.0

  parent reply	other threads:[~2019-08-26 20:51 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 16:50 [PATCH 0/3] Handling NFSv3 I/O errors in knfsd Trond Myklebust
2019-08-26 16:50 ` [PATCH 1/3] nfsd: nfsd_file cache entries should be per net namespace Trond Myklebust
2019-08-26 16:50   ` [PATCH 2/3] nfsd: Support the server resetting the boot verifier Trond Myklebust
2019-08-26 16:50     ` [PATCH 3/3] nfsd: Don't garbage collect files that might contain write errors Trond Myklebust
2019-08-27  7:58     ` [PATCH 2/3] nfsd: Support the server resetting the boot verifier kbuild test robot
2019-08-26 20:51 ` J. Bruce Fields [this message]
2019-08-26 21:02   ` [PATCH 0/3] Handling NFSv3 I/O errors in knfsd Trond Myklebust
2019-08-27  0:48     ` bfields
2019-08-27  0:56       ` Trond Myklebust
2019-08-27  1:13         ` bfields
2019-08-27  1:28           ` Trond Myklebust
2019-08-27 13:59     ` Chuck Lever
2019-08-27 14:53       ` Trond Myklebust
2019-08-27 14:58         ` bfields
2019-08-27 14:59           ` bfields
2019-08-27 15:15             ` Trond Myklebust
2019-08-27 15:20               ` Chuck Lever
2019-08-28 13:48               ` bfields
2019-08-28 13:51                 ` Jeff Layton
2019-08-28 13:57                   ` Chuck Lever
2019-08-28 14:00                     ` J. Bruce Fields
2019-08-28 14:03                       ` Chuck Lever
2019-08-28 14:16                         ` Jeff Layton
2019-08-28 14:21                           ` Chuck Lever
2019-08-28 14:40                           ` J. Bruce Fields
2019-08-28 14:48                             ` Bruce Fields
2019-08-28 14:50                               ` Chuck Lever
2019-08-28 17:07                                 ` Bruce Fields
2019-08-28 15:09                             ` Jeff Layton
2019-08-28 15:12                             ` Rick Macklem
2019-08-28 15:37                               ` Trond Myklebust
2019-08-28 15:46                               ` Bruce Fields
2019-08-27 14:54       ` Bruce Fields
2019-08-27 14:59         ` Trond Myklebust
2019-08-27 15:00           ` bfields
2019-08-27 15:17       ` Jeff Layton

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=20190826205156.GA27834@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.