diff mbox series

[2/2] nfsd: COPY with length 0 should copy to end of file

Message ID 1616112203-14672-2-git-send-email-bfields@redhat.com (mailing list archive)
State New, archived
Headers show
Series [1/2] nfsd: don't ignore high bits of copy count | expand

Commit Message

Bruce Fields March 19, 2021, 12:03 a.m. UTC
From: "J. Bruce Fields" <bfields@redhat.com>

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>
---
 fs/nfsd/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Chuck Lever March 22, 2021, 2:23 p.m. UTC | #1
> On Mar 18, 2021, at 8:03 PM, J. Bruce Fields <bfields@redhat.com> wrote:
> 
> From: "J. Bruce Fields" <bfields@redhat.com>
> 
> 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>

Hi Bruce -

These two have been committed to the for-next topic branch at

git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git


> ---
> fs/nfsd/nfs4proc.c | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 5419342df360..62354229f0b0 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;
> -- 
> 2.30.2
> 

--
Chuck Lever
diff mbox series

Patch

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 5419342df360..62354229f0b0 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;