Skip to content

NFSD support for async COPY

Olga Kornievskaia linux-nfs 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest9 patches 7 repliesIn review
  2. v99 patches 5 repliesSuperseded
  3. v89 patches 32 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v710 patches23 repliesSuperseded
v610 patches37 repliesSuperseded
v510 patches10 repliesSuperseded
v410 patches25 repliesSuperseded

Changes in v10 from the cover letter

-- removed the module parameter
-- nfsd4_init_copy_res() changed to void
-- freed async_copy in nfsd4_copy() on an error case caught by kbuild

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9NFSD CB_OFFLOAD xdrfs/nfsd/nfs4callback.c fs/nfsd/state.h fs/nfsd/xdr4.h +1 more+115 -00 replies
2/9NFSD OFFLOAD_STATUS xdrfs/nfsd/nfs4proc.c fs/nfsd/nfs4xdr.c fs/nfsd/xdr4.h+55 -20 replies
3/9NFSD OFFLOAD_CANCEL xdrfs/nfsd/nfs4proc.c fs/nfsd/nfs4xdr.c+15 -10 replies
4/9NFSD xdr callback stateid in async COPY replyfs/nfsd/nfs4xdr.c+17 -40 replies
5/9NFSD introduce async copy featurefs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c fs/nfsd/state.h +1 more+156 -170 replies
6/9NFSD create new stateid for async copyfs/nfsd/netns.h fs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c +3 more+56 -60 replies
7/9NFSD handle OFFLOAD_CANCEL opfs/nfsd/nfs4proc.c fs/nfsd/state.h fs/nfsd/xdr4.h+39 -30 replies
8/9NFSD support OFFLOAD_STATUSfs/nfsd/nfs4proc.c fs/nfsd/state.h+34 -130 replies
9/9NFSD stop ongoing async copies on client shutdownfs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c fs/nfsd/state.h +1 more+53 -60 replies

Reviews trailers per patch

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

Read the v10 thread

Cover letter [PATCH v10 0/9] NFSD support for async COPY

From: Olga Kornievskaia <[email protected]>

To do asynchronous copies, NFSD creates a new kthread to handle the request. Upon receiving the COPY, it generates a unique copy stateid (stored in a global list for keeping track of state for OFFLOAD_STATUS to be queried by), starts the thread, and replies back to the client. nfsd4_copy arguments that are allocated on the stack are copies for the kthread.

For the async copy handler, copy is done in the loop for the requested number of bytes. If an error is encountered and partial copy has happened, a successful partial copy is returned in the CB_OFFLOAD. vfs_copy_file_range is called with 4MB chunks for both async and sync, allowing for 4MB granularity of OFFLOAD_STATUS queiry. Once copy is done, the results are queued for the callback workqueue and sent via CB_OFFLOAD.

When the server received an OFFLOAD_CANCEL, it will find the kthread running the copy and will send a SIGPENDING and kthread_stop() and it will interrupt the ongoing do_splice() and once vfs returns we are choosing not to send the CB_OFFLOAD back to the client.

When the server receives an OFFLOAD_STATUS, it will find the kthread running the copy and will locate within the copy state the current number of bytes copied so far.

v10:
-- removed the module parameter
-- nfsd4_init_copy_res() changed to void
-- freed async_copy in nfsd4_copy() on an error case caught by kbuild

Olga Kornievskaia (9):
NFSD CB_OFFLOAD xdr
NFSD OFFLOAD_STATUS xdr
NFSD OFFLOAD_CANCEL xdr
NFSD xdr callback stateid in async COPY reply NFSD introduce async copy feature
NFSD create new stateid for async copy NFSD handle OFFLOAD_CANCEL op
NFSD support OFFLOAD_STATUS
NFSD stop ongoing async copies on client shutdown

 fs/nfsd/netns.h        |   8 ++
 fs/nfsd/nfs4callback.c |  98 +++++++++++++++++
 fs/nfsd/nfs4proc.c     | 293 ++++++++++++++++++++++++++++++++++++++++++++++---
 fs/nfsd/nfs4state.c    |  38 ++++++-
 fs/nfsd/nfs4xdr.c      |  50 +++++++--
 fs/nfsd/nfsctl.c       |   1 +
 fs/nfsd/state.h        |  10 ++
 fs/nfsd/xdr4.h         |  28 +++++
 fs/nfsd/xdr4cb.h       |  10 ++
 9 files changed, 512 insertions(+), 24 deletions(-)
Signature · 1 line
1.8.3.1