]> git.itanic.dy.fi Git - linux-stable/commit
NFSv4.2: fix client's attribute cache management for copy_file_range
authorOlga Kornievskaia <kolga@netapp.com>
Wed, 16 Sep 2020 13:07:54 +0000 (09:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Oct 2020 06:02:51 +0000 (08:02 +0200)
commitac376f2245bb790472112154b7f87ffb613e65f5
tree55e1d9ae0895798206f2ac36dbd98e8752daceed
parenta98e3583bd8d4ed8c5cab6a154a645aff8ea5873
NFSv4.2: fix client's attribute cache management for copy_file_range

[ Upstream commit 16abd2a0c124a6c3543c88ca4c53c997c9fb4114 ]

After client is done with the COPY operation, it needs to invalidate
its pagecache (as it did no reading or writing of the data locally)
and it needs to invalidate it's attributes just like it would have
for a read on the source file and write on the destination file.

Once the linux server started giving out read delegations to
read+write opens, the destination file of the copy_file range
started having delegations and not doing syncup on close of the
file leading to xfstest failures for generic/430,431,432,433,565.

v2: changing cache_validity needs to be protected by the i_lock.

Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
Fixes: 2e72448b07dc ("NFS: Add COPY nfs operation")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42proc.c