nfsclient copy_file_range(): flush dst vnode data

Otherwise server-side copy makes the client cache inconsistent with the
server data.

Reported by:	asomers
PR:	276002
Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43250
This commit is contained in:
Konstantin Belousov 2023-12-30 01:22:40 +02:00
parent 987446fa39
commit 7dae1467d7

View file

@ -3956,7 +3956,7 @@ generic_copy:
if (error == 0)
error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0);
if (error == 0)
error = ncl_flush(outvp, MNT_WAIT, curthread, 1, 0);
error = ncl_vinvalbuf(outvp, V_SAVE, curthread, 0);
/* Do the actual NFSv4.2 RPC. */
ret = ret2 = 0;