From: Darrick J. Wong Date: Fri, 31 May 2019 21:06:05 +0000 (-0700) Subject: nfs: disable client side deduplication X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9026b3a973b0b0b73c15ba40aff87cd0959fd0f3;p=linux.git nfs: disable client side deduplication 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 Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 3a507c42c1cae..52dbd17e401ed 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -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 */