diff options
author | J. Bruce Fields <bfields@redhat.com> | 2021-03-19 01:03:23 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2021-03-22 15:19:04 +0100 |
commit | 792a5112aa90e59c048b601c6382fe3498d75db7 (patch) | |
tree | 5f486b65fcfc752e8ca47f82000268c5e1ea21a8 /fs/nfsd | |
parent | nfsd: Fix typo "accesible" (diff) | |
download | linux-792a5112aa90e59c048b601c6382fe3498d75db7.tar.xz linux-792a5112aa90e59c048b601c6382fe3498d75db7.zip |
nfsd: COPY with length 0 should copy to end of file
>From https://tools.ietf.org/html/rfc7862#page-65
A count of 0 (zero) requests that all bytes from ca_src_offset
through EOF be copied to the destination.
Reported-by: <radchenkoy@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index c57cf09a8b60..d7b100a1e306 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1387,6 +1387,9 @@ static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy) u64 src_pos = copy->cp_src_pos; u64 dst_pos = copy->cp_dst_pos; + /* See RFC 7862 p.67: */ + if (bytes_total == 0) + bytes_total = ULLONG_MAX; do { if (kthread_should_stop()) break; |