]> git.ipfire.org Git - thirdparty/kernel/stable.git/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:48:42 +0000 (14:48 +0000)
commitbe8a177250b2ba387a55ce37dd4a8046a0ccab55
treef3bec69bd99ffa5648dea1451ef31e7135472349
parentfa8c776f4c323a9fbc8ddf25edcb962083391430
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