Skip to contentSkip to conversation

nfs: disable client side deduplication

PATCH New Darrick J. Wong 1 participant 1 message May 31, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: disable client side deduplication

From: Darrick J. Wong <[email protected]>

The NFS protocol doesn't support deduplication, so turn it off again.

Fixes ce96e888fe48e ("Fix nfs4.2 return -EINVAL when do dedupe operation")
---
 fs/nfs/nfs4file.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/nfs/nfs4file.c +5 -1
index cf42a8b939e3..1915f24bba85 100644
@@ -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 */