Commit 792a5112 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Chuck Lever
Browse files

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: default avatar <radchenkoy@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 34a62493
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;