All of lore.kernel.org
 help / color / mirror / Atom feed
From: trondmy@kernel.org
To: linux-nfs@vger.kernel.org
Subject: [PATCH v2 00/22] Fix NFS commit to DS
Date: Sat, 28 Mar 2020 11:31:58 -0400	[thread overview]
Message-ID: <20200328153220.1352010-1-trondmy@kernel.org> (raw)

From: Trond Myklebust <trond.myklebust@hammerspace.com>

The commit to DS code is currently broken in the face of layout
segments that do not cover the full file case. In particular, if
the layout is a flexfile mirrored layout, we see that if two layout
segments have differing numbers of mirrors, or just have different
ordering of mirrors, then the current code can lead to data
corruption and even kernel Oopses on the client.

The root cause of these problems is the fact that we have one
array of commit lists per struct pnfs_ds_commit_info, and
that once that array is set up, it cannot change. This despite
the fact that layout segments can be recalled and changed on
the fly.
This patch set attempts to fix that problem by changing the
array of commit lists into a list of lists. It does so in
a way that ensures 1-1 correspondence between a layout
segment and a set of commits for the case of buffered writes,
and a similar setup for a collection of O_DIRECT writes.

Since most of this work is acting on code that is currently
common to both the files layout and the flexfiles layout, I've
fixed up both layout types in the same way.

---
v2:
- Fix compile issues when !defined(CONFIG_NFS_V4_1)
- Code clean ups


Trond Myklebust (22):
  pNFS/flexfiles: Simplify allocation of the mirror array
  NFS/pNFS: Refactor pnfs_generic_commit_pagelist()
  pNFS: Add a helper to allocate the array of buckets
  NFSv4/pnfs: Support a list of commit arrays in struct
    pnfs_ds_commit_info
  NFSv4/pNFS: Scan the full list of commit arrays when committing
  pNFS: Support per-layout segment commits in
    pnfs_generic_recover_commit_reqs()
  pNFS: Support per-layout segment commits in
    pnfs_generic_commit_pagelist()
  NFS/pNFS: Allow O_DIRECT to release the DS commitinfo
  NFS: commit errors should be fatal
  NFS: Fix O_DIRECT commit verifier handling
  NFS/pNFS: Support commit arrays in
    nfs_clear_pnfs_ds_commit_verifiers()
  pNFS: Add infrastructure for cleaning up per-layout commit structures
  pNFS: Enable per-layout segment commit structures
  NFS/pNFS: Add a helper pnfs_generic_search_commit_reqs()
  NFS: Remove bucket array from struct pnfs_ds_commit_info
  NFS/pNFS: Clean up pNFS commit operations
  NFS/pNFS: Simplify bucket layout segment reference counting
  NFS/pNFS: Fix pnfs_layout_mark_request_commit() invalid layout segment
    handling
  pNFS/flexfile: Don't merge layout segments if the mirrors don't match
  pNFS/flexfiles: Check the layout segment range before doing I/O
  pNFS/flexfiles: remove requirement for whole file layouts
  pNFS/flexfiles: Specify the layout segment range in LAYOUTGET

 fs/nfs/direct.c                        | 174 +++------
 fs/nfs/filelayout/filelayout.c         | 163 +++-----
 fs/nfs/flexfilelayout/flexfilelayout.c | 203 ++++------
 fs/nfs/flexfilelayout/flexfilelayout.h |   2 +-
 fs/nfs/internal.h                      |  26 +-
 fs/nfs/pnfs.c                          |   4 +-
 fs/nfs/pnfs.h                          | 137 +++++--
 fs/nfs/pnfs_nfs.c                      | 514 ++++++++++++++++++-------
 fs/nfs/write.c                         |  16 +-
 include/linux/nfs_xdr.h                |  32 +-
 10 files changed, 709 insertions(+), 562 deletions(-)

-- 
2.25.1


             reply	other threads:[~2020-03-28 15:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 15:31 trondmy [this message]
2020-03-28 15:31 ` [PATCH v2 01/22] pNFS/flexfiles: Simplify allocation of the mirror array trondmy
2020-03-28 15:32   ` [PATCH v2 02/22] NFS/pNFS: Refactor pnfs_generic_commit_pagelist() trondmy
2020-03-28 15:32     ` [PATCH v2 03/22] pNFS: Add a helper to allocate the array of buckets trondmy
2020-03-28 15:32       ` [PATCH v2 04/22] NFSv4/pnfs: Support a list of commit arrays in struct pnfs_ds_commit_info trondmy
2020-03-28 15:32         ` [PATCH v2 05/22] NFSv4/pNFS: Scan the full list of commit arrays when committing trondmy
2020-03-28 15:32           ` [PATCH v2 06/22] pNFS: Support per-layout segment commits in pnfs_generic_recover_commit_reqs() trondmy
2020-03-28 15:32             ` [PATCH v2 07/22] pNFS: Support per-layout segment commits in pnfs_generic_commit_pagelist() trondmy
2020-03-28 15:32               ` [PATCH v2 08/22] NFS/pNFS: Allow O_DIRECT to release the DS commitinfo trondmy
2020-03-28 15:32                 ` [PATCH v2 09/22] NFS: commit errors should be fatal trondmy
2020-03-28 15:32                   ` [PATCH v2 10/22] NFS: Fix O_DIRECT commit verifier handling trondmy
2020-03-28 15:32                     ` [PATCH v2 11/22] NFS/pNFS: Support commit arrays in nfs_clear_pnfs_ds_commit_verifiers() trondmy
2020-03-28 15:32                       ` [PATCH v2 12/22] pNFS: Add infrastructure for cleaning up per-layout commit structures trondmy
2020-03-28 15:32                         ` [PATCH v2 13/22] pNFS: Enable per-layout segment " trondmy
2020-03-28 15:32                           ` [PATCH v2 14/22] NFS/pNFS: Add a helper pnfs_generic_search_commit_reqs() trondmy
2020-03-28 15:32                             ` [PATCH v2 15/22] NFS: Remove bucket array from struct pnfs_ds_commit_info trondmy
2020-03-28 15:32                               ` [PATCH v2 16/22] NFS/pNFS: Clean up pNFS commit operations trondmy
2020-03-28 15:32                                 ` [PATCH v2 17/22] NFS/pNFS: Simplify bucket layout segment reference counting trondmy
2020-03-28 15:32                                   ` [PATCH v2 18/22] NFS/pNFS: Fix pnfs_layout_mark_request_commit() invalid layout segment handling trondmy
2020-03-28 15:32                                     ` [PATCH v2 19/22] pNFS/flexfile: Don't merge layout segments if the mirrors don't match trondmy
2020-03-28 15:32                                       ` [PATCH v2 20/22] pNFS/flexfiles: Check the layout segment range before doing I/O trondmy
2020-03-28 15:32                                         ` [PATCH v2 21/22] pNFS/flexfiles: remove requirement for whole file layouts trondmy
2020-03-28 15:32                                           ` [PATCH v2 22/22] pNFS/flexfiles: Specify the layout segment range in LAYOUTGET trondmy

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=20200328153220.1352010-1-trondmy@kernel.org \
    --to=trondmy@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 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.