diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2024-04-30 16:05:11 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-05-06 09:07:23 -0400 |
commit | cc63c21682a51e24338baf30424b2987e05a556a (patch) | |
tree | 932851574e90e73bc23620f3af496bab5a0c3ac9 /fs/nfsd/xdr4.h | |
parent | a8483b9ad92c9d07122efe8697f0f42f6c41d1b1 (diff) |
NFSD: Add COPY status code to OFFLOAD_STATUS response
Clients that send an OFFLOAD_STATUS might want to distinguish
between an async COPY operation that is still running, has
completed successfully, or that has failed.
The intention of this patch is to make NFSD behave like this:
* Copy still running:
OFFLOAD_STATUS returns NFS4_OK, the number of bytes copied
so far, and an empty osr_status array
* Copy completed successfully:
OFFLOAD_STATUS returns NFS4_OK, the number of bytes copied,
and an osr_status of NFS4_OK
* Copy failed:
OFFLOAD_STATUS returns NFS4_OK, the number of bytes copied,
and an osr_status other than NFS4_OK
* Copy operation lost, canceled, or otherwise unrecognized:
OFFLOAD_STATUS returns NFS4ERR_BAD_STATEID
NB: Though RFC 7862 Section 11.2 lists a small set of NFS status
codes that are valid for OFFLOAD_STATUS, there do not seem to be any
explicit spec limits on the status codes that may be returned in the
osr_status field.
At this time we have no unit tests for COPY and its brethren, as
pynfs does not yet implement support for NFSv4.2.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/xdr4.h')
-rw-r--r-- | fs/nfsd/xdr4.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 62805931e857..fbdd42cde1fa 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -692,6 +692,7 @@ struct nfsd4_copy { #define NFSD4_COPY_F_INTRA (1) #define NFSD4_COPY_F_SYNCHRONOUS (2) #define NFSD4_COPY_F_COMMITTED (3) +#define NFSD4_COPY_F_COMPLETED (4) /* response */ __be32 nfserr; @@ -754,7 +755,8 @@ struct nfsd4_offload_status { /* response */ u64 count; - u32 status; + __be32 status; + bool completed; }; struct nfsd4_copy_notify { |