nfs: disable client side deduplication
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 31 May 2019 21:06:05 +0000 (14:06 -0700)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 6 Jul 2019 18:54:53 +0000 (14:54 -0400)
The NFS protocol doesn't support deduplication, so turn it off again.

Fixes: ce96e888fe48e ("Fix nfs4.2 return -EINVAL when do dedupe operation")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4file.c

index 3a507c4..52dbd17 100644 (file)
@@ -187,7 +187,11 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
        bool same_inode = false;
        int ret;
 
-       if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY))
+       /* NFS does not support deduplication. */
+       if (remap_flags & REMAP_FILE_DEDUP)
+               return -EOPNOTSUPP;
+
+       if (remap_flags & ~REMAP_FILE_ADVISORY)
                return -EINVAL;
 
        /* check alignment w.r.t. clone_blksize */