Skip to content

RFC NFSD: expand the implementation of OFFLOAD_STATUS

[email protected] linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2NFSD: Record status of async copy operation in struct nfsd4_copyfs/nfsd/nfs4proc.c fs/nfsd/xdr4.h+11 -110 replies
2/2NFSD: Add COPY status code to OFFLOAD_STATUS responsefs/nfsd/nfs4proc.c fs/nfsd/nfs4xdr.c fs/nfsd/xdr4.h+17 -40 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] NFSD: expand the implementation of OFFLOAD_STATUS

From: Chuck Lever <[email protected]>

I'm looking at RFC 7862 to try to understand what the various OFFLOAD_STATUS responses mean.

Quoted 6 lines

15.9.3. DESCRIPTION

OFFLOAD_STATUS can be used by the client to query the progress of an asynchronous operation, which is identified by both CURRENT_FH and the osa_stateid. If this operation is successful, the number of bytes processed is returned to the client in the osr_count field.

NFSD returns only the byte count today.

Quoted 3 lines

If the optional osr_complete field is present, the asynchronous operation has completed. In this case, the status value indicates the result of the asynchronous operation.

NFSD currently never returns the status code -- NFSD's response XDR encoder always stuffs "zero" in the array count for the osr_complete array. IMO, zero is OK, but only for the “COPY is still running” case.

Once the async COPY has completed, a subsequent OFFLOAD_STATUS should show that the COPY succeeded (or failed), until the server receives the client’s CB_OFFLOAD reply, or until the client’s lease expires.

For the "COPY has completed successfully" case, the above text suggests that OFFLOAD_STATUS returns NFS4_OK, and needs to return a proper status code in the osr_complete array: Probably NFS4_OK.

A "COPY has completed but failed" status can be reported by OFFLOAD_STATUS returning NFS4_OK and setting the osr_complete field to the failing COPY status code.

The two patches here change NFSD in that direction.

Chuck Lever (2):
NFSD: Record status of async copy operation in struct nfsd4_copy
NFSD: Add COPY status code to OFFLOAD_STATUS response

 fs/nfsd/nfs4proc.c | 31 ++++++++++++++++++-------------
 fs/nfsd/nfs4xdr.c  |  7 ++++++-
 fs/nfsd/xdr4.h     |  5 ++++-
 3 files changed, 28 insertions(+), 15 deletions(-)

base-commit: 06cd86b25b980a58e5584e9cd38c080467b24c25

Signature · 1 line
2.44.0