]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Fix nfs4.2 return -EINVAL when do dedupe operation
authorXiaoli Feng <fengxiaoli0714@gmail.com>
Sat, 16 Mar 2019 01:43:30 +0000 (09:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:23 +0000 (06:43 -0700)
commit50c312ad3ebd0c96e947b726dc06b9642a63aad1
tree262545da53c8fbc1ef92b361b661e2f829c9df6e
parente2130db17d007cf7f216fcb3f9a2d08ffe897620
Fix nfs4.2 return -EINVAL when do dedupe operation

[ Upstream commit ce96e888fe48ecfa868c9a39adc03292c78a80ff ]

dedupe_file_range operations is combiled into remap_file_range.
But in nfs42_remap_file_range, it's skiped for dedupe operations.
Before this patch:
  # dd if=/dev/zero of=nfs/file bs=1M count=1
  # xfs_io -c "dedupe nfs/file 4k 64k 4k" nfs/file
  XFS_IOC_FILE_EXTENT_SAME: Invalid argument
After this patch:
  # dd if=/dev/zero of=nfs/file bs=1M count=1
  # xfs_io -c "dedupe nfs/file 4k 64k 4k" nfs/file
  deduped 4096/4096 bytes at offset 65536
  4 KiB, 1 ops; 0.0046 sec (865.988 KiB/sec and 216.4971 ops/sec)

Signed-off-by: Xiaoli Feng <fengxiaoli0714@gmail.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4file.c