]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Mar 2024 11:32:50 +0000 (12:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Mar 2024 11:32:50 +0000 (12:32 +0100)
added patches:
nfs-fix-data-corruption-caused-by-congestion.patch

queue-6.1/nfs-fix-data-corruption-caused-by-congestion.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/nfs-fix-data-corruption-caused-by-congestion.patch b/queue-6.1/nfs-fix-data-corruption-caused-by-congestion.patch
new file mode 100644 (file)
index 0000000..b56e7a8
--- /dev/null
@@ -0,0 +1,46 @@
+From neilb@suse.de  Mon Mar  4 12:30:45 2024
+From: "NeilBrown" <neilb@suse.de>
+Date: Wed, 28 Feb 2024 10:25:49 +1100
+Subject: NFS: Fix data corruption caused by congestion.
+To: stable@vger.kernel.org, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>
+Cc: linux-nfs@vger.kernel.org,  Jacek Tomaka <Jacek.Tomaka@poczta.fm>
+Message-ID: <170907634991.24797.14120500624611379941@noble.neil.brown.name>
+
+From: "NeilBrown" <neilb@suse.de>
+
+when AOP_WRITEPAGE_ACTIVATE is returned (as NFS does when it detects
+congestion) it is important that the page 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.  From 6.3 onward the patch
+is different as it needs to mention "folio", not "page".
+
+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 | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/fs/nfs/write.c b/fs/nfs/write.c
+index f41d24b54fd1..6a0606668417 100644
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -667,8 +667,10 @@ static int nfs_writepage_locked(struct page *page,
+       int err;
+       if (wbc->sync_mode == WB_SYNC_NONE &&
+-          NFS_SERVER(inode)->write_congested)
++          NFS_SERVER(inode)->write_congested) {
++              redirty_page_for_writepage(wbc, page);
+               return AOP_WRITEPAGE_ACTIVATE;
++      }
+       nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
+       nfs_pageio_init_write(&pgio, inode, 0,
+-- 
+2.43.0
+
index efecf6910088d866fec091ae6128d19aee998d86..c56397b0b3edeeb34cb7f652b5ae2dfedd4b7bf1 100644 (file)
@@ -140,3 +140,4 @@ x86-decompressor-merge-trampoline-cleanup-with-switching-code.patch
 x86-decompressor-move-global-symbol-references-to-c-code.patch
 decompress-use-8-byte-alignment.patch
 drm-amd-display-increase-frame-warning-limit-with-kasan-or-kcsan-in-dml.patch
+nfs-fix-data-corruption-caused-by-congestion.patch