]> git.itanic.dy.fi Git - linux-stable/commit
NFS: Fix data corruption caused by congestion.
authorNeilBrown <neilb@suse.de>
Tue, 27 Feb 2024 23:23:31 +0000 (10:23 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:53:58 +0000 (14:53 +0000)
commit5fa917a67a03451cded859349249b8b7d08c3865
tree66ddd89164c867468e58eebc24890e4b32d1ad3a
parentc9633fcb4dbcd4d5f4f25380e5cccb289a33cdd9
NFS: Fix data corruption caused by congestion.

when AOP_WRITEPAGE_ACTIVATE is returned (as NFS does when it detects
congestion) it is important that the folio is redirtied.
nfs_writepage_locked() doesn't do this, so files can become corrupted as
writes can be lost.

Note that this is not needed in v6.8 as AOP_WRITEPAGE_ACTIVATE cannot be
returned.  It is needed for kernels v5.18..v6.7.  Prior to 6.3 the patch
is different as it needs to mention "page", not "folio".

Reported-and-tested-by: Jacek Tomaka <Jacek.Tomaka@poczta.fm>
Fixes: 6df25e58532b ("nfs: remove reliance on bdi congestion")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/write.c