Skip to content

NFS: layout changes while building mirrored writes

Benjamin Coddington linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2NFS: Resend unsent mirror requests when an O_DIRECT write hits -EAGAINfs/nfs/direct.c fs/nfs/pagelist.c fs/nfs/read.c +2 more+38 -90 replies
2/2NFS: Don't warn when a changed layout refuses a split subrequestfs/nfs/pagelist.c+13 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] NFS: layout changes while building mirrored writes

From: Benjamin Coddington <[email protected]>

These two fix trouble the pageio code has when a flexfiles layout is recalled and comes back with a different mirror count while a write is being built. The first is data loss: an O_DIRECT write drops one mirror's share of the bytes and still returns success. The second is a WARN_ON_ONCE in __nfs_pageio_add_request() that the same race trips when a request has to be split, which looks like a pg_test bug but isn't.

I reproduced this against a server that alternates each RW layout between three mirrors and two and recalls it about a millisecond after granting it, with mirrors at different wsizes (1M and 64K). Without these, 5 of 10 64MiB O_DIRECT rewrites left the 1M mirror holding the previous data in 64K multiples. With them I haven't seen a loss the client was responsible for in a few hundred iterations, buffered or O_DIRECT. Buffered writes weren't affected by the first problem since nfs_async_write_error() redirties on -EAGAIN.

Benjamin Coddington (2):
NFS: Resend unsent mirror requests when an O_DIRECT write hits -EAGAIN
NFS: Don't warn when a changed layout refuses a split subrequest

 fs/nfs/direct.c         | 28 ++++++++++++++++++++++++++--
 fs/nfs/pagelist.c       | 20 ++++++++++++++++----
 fs/nfs/read.c           |  3 ++-
 fs/nfs/write.c          |  5 +++--
 include/linux/nfs_xdr.h |  5 ++++-
 5 files changed, 51 insertions(+), 10 deletions(-)
Signature · 1 line
2.53.0