diff options
author | Murphy Zhou <jencce.kernel@gmail.com> | 2020-02-14 17:34:09 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-23 11:36:31 +0300 |
commit | 59bafdc99440ca6aef8bd1a93491d637a09853f2 (patch) | |
tree | 04917ac54f55c36feba5a0ef250d02e94c9e5904 /fs | |
parent | 264e3f1597e8f6d45caf815f6883c4c98a8ed056 (diff) | |
download | linux-59bafdc99440ca6aef8bd1a93491d637a09853f2.tar.xz |
NFSv4.2: error out when relink swapfile
[ Upstream commit f5fdf1243fb750598b46305dd03c553949cfa14f ]
This fixes xfstests generic/356 failure on NFSv4.2.
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 54f1c1f626fc..fb55c04cdc6b 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -210,6 +210,9 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off, if (remap_flags & ~REMAP_FILE_ADVISORY) return -EINVAL; + if (IS_SWAPFILE(dst_inode) || IS_SWAPFILE(src_inode)) + return -ETXTBSY; + /* check alignment w.r.t. clone_blksize */ ret = -EINVAL; if (bs) { |