]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
NFSv4.1 fix incorrect return value in copy_file_range
authorOlga Kornievskaia <kolga@netapp.com>
Thu, 11 Apr 2019 18:34:18 +0000 (14:34 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 2 Jul 2019 10:07:53 +0000 (12:07 +0200)
commit875714fe33a1a53890712e40ac9aeabeb35b1f34
tree5c53557e38d9447b91fc55b069f02436349331cc
parent7ae0d6e89f7109c6ac6c1ea7307682e9bcadbb6b
NFSv4.1 fix incorrect return value in copy_file_range

BugLink: https://bugs.launchpad.net/bugs/1834529
[ Upstream commit 0769663b4f580566ef6cdf366f3073dbe8022c39 ]

According to the NFSv4.2 spec if the input and output file is the
same file, operation should fail with EINVAL. However, linux
copy_file_range() system call has no such restrictions. Therefore,
in such case let's return EOPNOTSUPP and allow VFS to fallback
to doing do_splice_direct(). Also when copy_file_range is called
on an NFSv4.0 or 4.1 mount (ie., a server that doesn't support
COPY functionality), we also need to return EOPNOTSUPP and
fallback to a regular copy.

Fixes xfstest generic/075, generic/091, generic/112, generic/263
for all NFSv4.x versions.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/nfs/nfs42proc.c
fs/nfs/nfs4file.c