Commit f5fdf124 authored by Murphy Zhou's avatar Murphy Zhou Committed by Trond Myklebust

NFSv4.2: error out when relink swapfile

This fixes xfstests generic/356 failure on NFSv4.2.
Signed-off-by: default avatarMurphy Zhou <jencce.kernel@gmail.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent eb095c14
...@@ -252,6 +252,9 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off, ...@@ -252,6 +252,9 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
if (remap_flags & ~REMAP_FILE_ADVISORY) if (remap_flags & ~REMAP_FILE_ADVISORY)
return -EINVAL; return -EINVAL;
if (IS_SWAPFILE(dst_inode) || IS_SWAPFILE(src_inode))
return -ETXTBSY;
/* check alignment w.r.t. clone_blksize */ /* check alignment w.r.t. clone_blksize */
ret = -EINVAL; ret = -EINVAL;
if (bs) { if (bs) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment