]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
start 6.1 review cycle for some reverts
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2023 18:01:41 +0000 (20:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2023 18:01:41 +0000 (20:01 +0200)
queue-6.1/series
review-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch [new file with mode: 0644]
review-6.1/revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patch [new file with mode: 0644]
review-6.1/revert-nfs-fix-o_direct-locking-issues.patch [new file with mode: 0644]
review-6.1/revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch [new file with mode: 0644]
review-6.1/revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch [new file with mode: 0644]
review-6.1/revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch [new file with mode: 0644]
review-6.1/series [new file with mode: 0644]

index 63c79048786ccb839b1bd13be5be67310ea0a255..15028a7f6af9dfdc193818649a4674916c97e194 100644 (file)
@@ -1,4 +1,8 @@
-net-mana-fix-tx-cqe-error-handling.patch
+revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch
+revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch
+revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch
+revert-nfs-fix-o_direct-locking-issues.patch
+revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patchnet-mana-fix-tx-cqe-error-handling.patch
 mptcp-fix-delegated-action-races.patch
 drm-i915-don-t-set-pipe_control_flush_l3-for-aux-inv.patch
 rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch
@@ -12,8 +16,3 @@ quota-fix-slow-quotaoff.patch
 asoc-amd-yc-fix-non-functional-mic-on-lenovo-82ym.patch
 ata-libata-scsi-disable-scsi-device-manage_system_start_stop.patch
 net-prevent-address-rewrite-in-kernel_bind.patch
-revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch
-revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch
-revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch
-revert-nfs-fix-o_direct-locking-issues.patch
-revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patch
diff --git a/review-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch b/review-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch
new file mode 100644 (file)
index 0000000..7f09d25
--- /dev/null
@@ -0,0 +1,41 @@
+From gregkh@linuxfoundation.org  Thu Oct 12 18:44:27 2023
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 10:17:39 +0200
+Subject: lib/test_meminit: fix off-by-one error in test_pages()
+To: linux-kernel@vger.kernel.org
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andrew Donnellan <ajd@linux.ibm.com>, Alexander Potapenko <glider@google.com>, Xiaoke Wang <xkernel.wang@foxmail.com>, stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
+Message-ID: <2023101238-greasily-reiterate-aafc@gregkh>
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit efb78fa86e95 ("lib/test_meminit: allocate pages up to order
+MAX_ORDER") works great in kernels 6.4 and newer thanks to commit
+23baf831a32c ("mm, treewide: redefine MAX_ORDER sanely"), but for older
+kernels, the loop is off by one, which causes crashes when the test
+runs.
+
+Fix this up by changing "<= MAX_ORDER" "< MAX_ORDER" to allow the test
+to work properly for older kernel branches.
+
+Fixes: 421855d0d24d ("lib/test_meminit: allocate pages up to order MAX_ORDER")
+Cc: Andrew Donnellan <ajd@linux.ibm.com>
+Cc: Alexander Potapenko <glider@google.com>
+Cc: Xiaoke Wang <xkernel.wang@foxmail.com>
+Cc: <stable@vger.kernel.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/test_meminit.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/test_meminit.c
++++ b/lib/test_meminit.c
+@@ -93,7 +93,7 @@ static int __init test_pages(int *total_
+       int failures = 0, num_tests = 0;
+       int i;
+-      for (i = 0; i <= MAX_ORDER; i++)
++      for (i = 0; i < MAX_ORDER; i++)
+               num_tests += do_alloc_pages_order(i, &failures);
+       REPORT_FAILURES_IN_FN();
diff --git a/review-6.1/revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patch b/review-6.1/revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patch
new file mode 100644 (file)
index 0000000..d2232e9
--- /dev/null
@@ -0,0 +1,142 @@
+From 7c75a3885d8620158e7ed2656fd6f9c2e14f5fdb Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 19:41:42 +0200
+Subject: Revert "NFS: Fix error handling for O_DIRECT write scheduling"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit f16fd0b11f0f4d41846b5102b1656ea1fc9ac7a0 which is
+commit 954998b60caa8f2a3bf3abe490de6f08d283687a upstream.
+
+There are reported NFS problems in the 6.1.56 release, so revert a set
+of NFS patches to hopefully resolve the issue.
+
+Reported-by: poester <poester@internetbrands.com>
+Link: https://lore.kernel.org/r/20231012165439.137237-2-kernel@linuxace.com
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Link: https://lore.kernel.org/r/2023100755-livestock-barcode-fe41@gregkh
+Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/direct.c |   62 ++++++++++++++------------------------------------------
+ 1 file changed, 16 insertions(+), 46 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -530,9 +530,10 @@ nfs_direct_write_scan_commit_list(struct
+ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
+ {
+       struct nfs_pageio_descriptor desc;
+-      struct nfs_page *req;
++      struct nfs_page *req, *tmp;
+       LIST_HEAD(reqs);
+       struct nfs_commit_info cinfo;
++      LIST_HEAD(failed);
+       nfs_init_cinfo_from_dreq(&cinfo, dreq);
+       nfs_direct_write_scan_commit_list(dreq->inode, &reqs, &cinfo);
+@@ -550,36 +551,27 @@ static void nfs_direct_write_reschedule(
+                             &nfs_direct_write_completion_ops);
+       desc.pg_dreq = dreq;
+-      while (!list_empty(&reqs)) {
+-              req = nfs_list_entry(reqs.next);
++      list_for_each_entry_safe(req, tmp, &reqs, wb_list) {
+               /* Bump the transmission count */
+               req->wb_nio++;
+               if (!nfs_pageio_add_request(&desc, req)) {
++                      nfs_list_move_request(req, &failed);
+                       spin_lock(&cinfo.inode->i_lock);
+-                      if (dreq->error < 0) {
+-                              desc.pg_error = dreq->error;
+-                      } else if (desc.pg_error != -EAGAIN) {
+-                              dreq->flags = 0;
+-                              if (!desc.pg_error)
+-                                      desc.pg_error = -EIO;
++                      dreq->flags = 0;
++                      if (desc.pg_error < 0)
+                               dreq->error = desc.pg_error;
+-                      } else
+-                              dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
++                      else
++                              dreq->error = -EIO;
+                       spin_unlock(&cinfo.inode->i_lock);
+-                      break;
+               }
+               nfs_release_request(req);
+       }
+       nfs_pageio_complete(&desc);
+-      while (!list_empty(&reqs)) {
+-              req = nfs_list_entry(reqs.next);
++      while (!list_empty(&failed)) {
++              req = nfs_list_entry(failed.next);
+               nfs_list_remove_request(req);
+               nfs_unlock_and_release_request(req);
+-              if (desc.pg_error == -EAGAIN)
+-                      nfs_mark_request_commit(req, NULL, &cinfo, 0);
+-              else
+-                      nfs_release_request(req);
+       }
+       if (put_dreq(dreq))
+@@ -804,11 +796,9 @@ static ssize_t nfs_direct_write_schedule
+ {
+       struct nfs_pageio_descriptor desc;
+       struct inode *inode = dreq->inode;
+-      struct nfs_commit_info cinfo;
+       ssize_t result = 0;
+       size_t requested_bytes = 0;
+       size_t wsize = max_t(size_t, NFS_SERVER(inode)->wsize, PAGE_SIZE);
+-      bool defer = false;
+       trace_nfs_direct_write_schedule_iovec(dreq);
+@@ -849,39 +839,19 @@ static ssize_t nfs_direct_write_schedule
+                               break;
+                       }
+-                      pgbase = 0;
+-                      bytes -= req_len;
+-                      requested_bytes += req_len;
+-                      pos += req_len;
+-                      dreq->bytes_left -= req_len;
+-
+-                      if (defer) {
+-                              nfs_mark_request_commit(req, NULL, &cinfo, 0);
+-                              continue;
+-                      }
+-
+                       nfs_lock_request(req);
+                       req->wb_index = pos >> PAGE_SHIFT;
+                       req->wb_offset = pos & ~PAGE_MASK;
+-                      if (nfs_pageio_add_request(&desc, req))
+-                              continue;
+-
+-                      /* Exit on hard errors */
+-                      if (desc.pg_error < 0 && desc.pg_error != -EAGAIN) {
++                      if (!nfs_pageio_add_request(&desc, req)) {
+                               result = desc.pg_error;
+                               nfs_unlock_and_release_request(req);
+                               break;
+                       }
+-
+-                      /* If the error is soft, defer remaining requests */
+-                      nfs_init_cinfo_from_dreq(&cinfo, dreq);
+-                      spin_lock(&cinfo.inode->i_lock);
+-                      dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+-                      spin_unlock(&cinfo.inode->i_lock);
+-                      nfs_unlock_request(req);
+-                      nfs_mark_request_commit(req, NULL, &cinfo, 0);
+-                      desc.pg_error = 0;
+-                      defer = true;
++                      pgbase = 0;
++                      bytes -= req_len;
++                      requested_bytes += req_len;
++                      pos += req_len;
++                      dreq->bytes_left -= req_len;
+               }
+               nfs_direct_release_pages(pagevec, npages);
+               kvfree(pagevec);
diff --git a/review-6.1/revert-nfs-fix-o_direct-locking-issues.patch b/review-6.1/revert-nfs-fix-o_direct-locking-issues.patch
new file mode 100644 (file)
index 0000000..07a499e
--- /dev/null
@@ -0,0 +1,57 @@
+From acea018acafb9b006c5b5c091d6caf1833ae3d57 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 19:41:41 +0200
+Subject: Revert "NFS: Fix O_DIRECT locking issues"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit 4d98038e5bd939bd13cc4e602dfe60cd5110efa8 which is
+commit 7c6339322ce0c6128acbe36aacc1eeb986dd7bf1 upstream.
+
+There are reported NFS problems in the 6.1.56 release, so revert a set
+of NFS patches to hopefully resolve the issue.
+
+Reported-by: poester <poester@internetbrands.com>
+Link: https://lore.kernel.org/r/20231012165439.137237-2-kernel@linuxace.com
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Link: https://lore.kernel.org/r/2023100755-livestock-barcode-fe41@gregkh
+Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/direct.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -555,7 +555,7 @@ static void nfs_direct_write_reschedule(
+               /* Bump the transmission count */
+               req->wb_nio++;
+               if (!nfs_pageio_add_request(&desc, req)) {
+-                      spin_lock(&dreq->lock);
++                      spin_lock(&cinfo.inode->i_lock);
+                       if (dreq->error < 0) {
+                               desc.pg_error = dreq->error;
+                       } else if (desc.pg_error != -EAGAIN) {
+@@ -565,7 +565,7 @@ static void nfs_direct_write_reschedule(
+                               dreq->error = desc.pg_error;
+                       } else
+                               dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+-                      spin_unlock(&dreq->lock);
++                      spin_unlock(&cinfo.inode->i_lock);
+                       break;
+               }
+               nfs_release_request(req);
+@@ -875,9 +875,9 @@ static ssize_t nfs_direct_write_schedule
+                       /* If the error is soft, defer remaining requests */
+                       nfs_init_cinfo_from_dreq(&cinfo, dreq);
+-                      spin_lock(&dreq->lock);
++                      spin_lock(&cinfo.inode->i_lock);
+                       dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+-                      spin_unlock(&dreq->lock);
++                      spin_unlock(&cinfo.inode->i_lock);
+                       nfs_unlock_request(req);
+                       nfs_mark_request_commit(req, NULL, &cinfo, 0);
+                       desc.pg_error = 0;
diff --git a/review-6.1/revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch b/review-6.1/revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch
new file mode 100644 (file)
index 0000000..ab37bfb
--- /dev/null
@@ -0,0 +1,57 @@
+From 6367b15c4fe4714eab779f45577141ae8b484984 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 19:41:37 +0200
+Subject: Revert "NFS: More fixes for nfs_direct_write_reschedule_io()"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit edd1f06145101dab83497806bb6162641255ef50 which is
+commit b11243f720ee5f9376861099019c8542969b6318 upstream.
+
+There are reported NFS problems in the 6.1.56 release, so revert a set
+of NFS patches to hopefully resolve the issue.
+
+Reported-by: poester <poester@internetbrands.com>
+Link: https://lore.kernel.org/r/20231012165439.137237-2-kernel@linuxace.com
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Link: https://lore.kernel.org/r/2023100755-livestock-barcode-fe41@gregkh
+Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/direct.c |   17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -782,23 +782,18 @@ static void nfs_write_sync_pgio_error(st
+ static void nfs_direct_write_reschedule_io(struct nfs_pgio_header *hdr)
+ {
+       struct nfs_direct_req *dreq = hdr->dreq;
+-      struct nfs_page *req;
+-      struct nfs_commit_info cinfo;
+       trace_nfs_direct_write_reschedule_io(dreq);
+-      nfs_init_cinfo_from_dreq(&cinfo, dreq);
+       spin_lock(&dreq->lock);
+-      if (dreq->error == 0)
++      if (dreq->error == 0) {
+               dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+-      set_bit(NFS_IOHDR_REDO, &hdr->flags);
+-      spin_unlock(&dreq->lock);
+-      while (!list_empty(&hdr->pages)) {
+-              req = nfs_list_entry(hdr->pages.next);
+-              nfs_list_remove_request(req);
+-              nfs_unlock_request(req);
+-              nfs_mark_request_commit(req, NULL, &cinfo, 0);
++              /* fake unstable write to let common nfs resend pages */
++              hdr->verf.committed = NFS_UNSTABLE;
++              hdr->good_bytes = hdr->args.offset + hdr->args.count -
++                      hdr->io_start;
+       }
++      spin_unlock(&dreq->lock);
+ }
+ static const struct nfs_pgio_completion_ops nfs_direct_write_completion_ops = {
diff --git a/review-6.1/revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch b/review-6.1/revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch
new file mode 100644 (file)
index 0000000..feda308
--- /dev/null
@@ -0,0 +1,140 @@
+From 73d54c364eaa2a8f4d8f940e45ca3e0bddf69459 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 19:41:40 +0200
+Subject: Revert "NFS: More O_DIRECT accounting fixes for error paths"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit 1f49386d67792424028acfe781d466b010f8fa3f which is
+commit 8982f7aff39fb526aba4441fff2525fcedd5e1a3 upstream.
+
+There are reported NFS problems in the 6.1.56 release, so revert a set
+of NFS patches to hopefully resolve the issue.
+
+Reported-by: poester <poester@internetbrands.com>
+Link: https://lore.kernel.org/r/20231012165439.137237-2-kernel@linuxace.com
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Link: https://lore.kernel.org/r/2023100755-livestock-barcode-fe41@gregkh
+Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/direct.c |   47 ++++++++++++++++-------------------------------
+ 1 file changed, 16 insertions(+), 31 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -93,10 +93,12 @@ nfs_direct_handle_truncated(struct nfs_d
+               dreq->max_count = dreq_len;
+               if (dreq->count > dreq_len)
+                       dreq->count = dreq_len;
+-      }
+-      if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && !dreq->error)
+-              dreq->error = hdr->error;
++              if (test_bit(NFS_IOHDR_ERROR, &hdr->flags))
++                      dreq->error = hdr->error;
++              else /* Clear outstanding error if this is EOF */
++                      dreq->error = 0;
++      }
+ }
+ static void
+@@ -118,18 +120,6 @@ nfs_direct_count_bytes(struct nfs_direct
+               dreq->count = dreq_len;
+ }
+-static void nfs_direct_truncate_request(struct nfs_direct_req *dreq,
+-                                      struct nfs_page *req)
+-{
+-      loff_t offs = req_offset(req);
+-      size_t req_start = (size_t)(offs - dreq->io_start);
+-
+-      if (req_start < dreq->max_count)
+-              dreq->max_count = req_start;
+-      if (req_start < dreq->count)
+-              dreq->count = req_start;
+-}
+-
+ /**
+  * nfs_swap_rw - NFS address space operation for swap I/O
+  * @iocb: target I/O control block
+@@ -549,6 +539,10 @@ static void nfs_direct_write_reschedule(
+       nfs_direct_join_group(&reqs, dreq->inode);
++      dreq->count = 0;
++      dreq->max_count = 0;
++      list_for_each_entry(req, &reqs, wb_list)
++              dreq->max_count += req->wb_bytes;
+       nfs_clear_pnfs_ds_commit_verifiers(&dreq->ds_cinfo);
+       get_dreq(dreq);
+@@ -582,14 +576,10 @@ static void nfs_direct_write_reschedule(
+               req = nfs_list_entry(reqs.next);
+               nfs_list_remove_request(req);
+               nfs_unlock_and_release_request(req);
+-              if (desc.pg_error == -EAGAIN) {
++              if (desc.pg_error == -EAGAIN)
+                       nfs_mark_request_commit(req, NULL, &cinfo, 0);
+-              } else {
+-                      spin_lock(&dreq->lock);
+-                      nfs_direct_truncate_request(dreq, req);
+-                      spin_unlock(&dreq->lock);
++              else
+                       nfs_release_request(req);
+-              }
+       }
+       if (put_dreq(dreq))
+@@ -609,6 +599,8 @@ static void nfs_direct_commit_complete(s
+       if (status < 0) {
+               /* Errors in commit are fatal */
+               dreq->error = status;
++              dreq->max_count = 0;
++              dreq->count = 0;
+               dreq->flags = NFS_ODIRECT_DONE;
+       } else {
+               status = dreq->error;
+@@ -619,12 +611,7 @@ static void nfs_direct_commit_complete(s
+       while (!list_empty(&data->pages)) {
+               req = nfs_list_entry(data->pages.next);
+               nfs_list_remove_request(req);
+-              if (status < 0) {
+-                      spin_lock(&dreq->lock);
+-                      nfs_direct_truncate_request(dreq, req);
+-                      spin_unlock(&dreq->lock);
+-                      nfs_release_request(req);
+-              } else if (!nfs_write_match_verf(verf, req)) {
++              if (status >= 0 && !nfs_write_match_verf(verf, req)) {
+                       dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+                       /*
+                        * Despite the reboot, the write was successful,
+@@ -632,7 +619,7 @@ static void nfs_direct_commit_complete(s
+                        */
+                       req->wb_nio = 0;
+                       nfs_mark_request_commit(req, NULL, &cinfo, 0);
+-              } else
++              } else /* Error or match */
+                       nfs_release_request(req);
+               nfs_unlock_and_release_request(req);
+       }
+@@ -685,7 +672,6 @@ static void nfs_direct_write_clear_reqs(
+       while (!list_empty(&reqs)) {
+               req = nfs_list_entry(reqs.next);
+               nfs_list_remove_request(req);
+-              nfs_direct_truncate_request(dreq, req);
+               nfs_release_request(req);
+               nfs_unlock_and_release_request(req);
+       }
+@@ -735,8 +721,7 @@ static void nfs_direct_write_completion(
+       }
+       nfs_direct_count_bytes(dreq, hdr);
+-      if (test_bit(NFS_IOHDR_UNSTABLE_WRITES, &hdr->flags) &&
+-          !test_bit(NFS_IOHDR_ERROR, &hdr->flags)) {
++      if (test_bit(NFS_IOHDR_UNSTABLE_WRITES, &hdr->flags)) {
+               if (!dreq->flags)
+                       dreq->flags = NFS_ODIRECT_DO_COMMIT;
+               flags = dreq->flags;
diff --git a/review-6.1/revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch b/review-6.1/revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch
new file mode 100644 (file)
index 0000000..26109b1
--- /dev/null
@@ -0,0 +1,146 @@
+From 83075c81c82e00639e5ab66ec7799bddbbf9b389 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 19:41:39 +0200
+Subject: Revert "NFS: Use the correct commit info in nfs_join_page_group()"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit d4729af1c73cfacb64facda3d196e25940f0e7a5 which is
+commit b193a78ddb5ee7dba074d3f28dc050069ba083c0 upstream.
+
+There are reported NFS problems in the 6.1.56 release, so revert a set
+of NFS patches to hopefully resolve the issue.
+
+Reported-by: poester <poester@internetbrands.com>
+Link: https://lore.kernel.org/r/20231012165439.137237-2-kernel@linuxace.com
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Link: https://lore.kernel.org/r/2023100755-livestock-barcode-fe41@gregkh
+Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/direct.c          |    8 +++-----
+ fs/nfs/write.c           |   23 +++++++++++------------
+ include/linux/nfs_page.h |    4 +---
+ 3 files changed, 15 insertions(+), 20 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -500,9 +500,7 @@ static void nfs_direct_add_page_head(str
+       kref_get(&head->wb_kref);
+ }
+-static void nfs_direct_join_group(struct list_head *list,
+-                                struct nfs_commit_info *cinfo,
+-                                struct inode *inode)
++static void nfs_direct_join_group(struct list_head *list, struct inode *inode)
+ {
+       struct nfs_page *req, *subreq;
+@@ -524,7 +522,7 @@ static void nfs_direct_join_group(struct
+                               nfs_release_request(subreq);
+                       }
+               } while ((subreq = subreq->wb_this_page) != req);
+-              nfs_join_page_group(req, cinfo, inode);
++              nfs_join_page_group(req, inode);
+       }
+ }
+@@ -549,7 +547,7 @@ static void nfs_direct_write_reschedule(
+       nfs_init_cinfo_from_dreq(&cinfo, dreq);
+       nfs_direct_write_scan_commit_list(dreq->inode, &reqs, &cinfo);
+-      nfs_direct_join_group(&reqs, &cinfo, dreq->inode);
++      nfs_direct_join_group(&reqs, dreq->inode);
+       nfs_clear_pnfs_ds_commit_verifiers(&dreq->ds_cinfo);
+       get_dreq(dreq);
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -58,8 +58,7 @@ static const struct nfs_pgio_completion_
+ static const struct nfs_commit_completion_ops nfs_commit_completion_ops;
+ static const struct nfs_rw_ops nfs_rw_write_ops;
+ static void nfs_inode_remove_request(struct nfs_page *req);
+-static void nfs_clear_request_commit(struct nfs_commit_info *cinfo,
+-                                   struct nfs_page *req);
++static void nfs_clear_request_commit(struct nfs_page *req);
+ static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo,
+                                     struct inode *inode);
+ static struct nfs_page *
+@@ -503,8 +502,8 @@ nfs_destroy_unlinked_subrequests(struct
+  * the (former) group.  All subrequests are removed from any write or commit
+  * lists, unlinked from the group and destroyed.
+  */
+-void nfs_join_page_group(struct nfs_page *head, struct nfs_commit_info *cinfo,
+-                       struct inode *inode)
++void
++nfs_join_page_group(struct nfs_page *head, struct inode *inode)
+ {
+       struct nfs_page *subreq;
+       struct nfs_page *destroy_list = NULL;
+@@ -534,7 +533,7 @@ void nfs_join_page_group(struct nfs_page
+        * Commit list removal accounting is done after locks are dropped */
+       subreq = head;
+       do {
+-              nfs_clear_request_commit(cinfo, subreq);
++              nfs_clear_request_commit(subreq);
+               subreq = subreq->wb_this_page;
+       } while (subreq != head);
+@@ -568,10 +567,8 @@ nfs_lock_and_join_requests(struct page *
+ {
+       struct inode *inode = page_file_mapping(page)->host;
+       struct nfs_page *head;
+-      struct nfs_commit_info cinfo;
+       int ret;
+-      nfs_init_cinfo_from_inode(&cinfo, inode);
+       /*
+        * A reference is taken only on the head request which acts as a
+        * reference to the whole page group - the group will not be destroyed
+@@ -588,7 +585,7 @@ nfs_lock_and_join_requests(struct page *
+               return ERR_PTR(ret);
+       }
+-      nfs_join_page_group(head, &cinfo, inode);
++      nfs_join_page_group(head, inode);
+       return head;
+ }
+@@ -959,16 +956,18 @@ nfs_clear_page_commit(struct page *page)
+ }
+ /* Called holding the request lock on @req */
+-static void nfs_clear_request_commit(struct nfs_commit_info *cinfo,
+-                                   struct nfs_page *req)
++static void
++nfs_clear_request_commit(struct nfs_page *req)
+ {
+       if (test_bit(PG_CLEAN, &req->wb_flags)) {
+               struct nfs_open_context *ctx = nfs_req_openctx(req);
+               struct inode *inode = d_inode(ctx->dentry);
++              struct nfs_commit_info cinfo;
++              nfs_init_cinfo_from_inode(&cinfo, inode);
+               mutex_lock(&NFS_I(inode)->commit_mutex);
+-              if (!pnfs_clear_request_commit(req, cinfo)) {
+-                      nfs_request_remove_commit_list(req, cinfo);
++              if (!pnfs_clear_request_commit(req, &cinfo)) {
++                      nfs_request_remove_commit_list(req, &cinfo);
+               }
+               mutex_unlock(&NFS_I(inode)->commit_mutex);
+               nfs_clear_page_commit(req->wb_page);
+--- a/include/linux/nfs_page.h
++++ b/include/linux/nfs_page.h
+@@ -145,9 +145,7 @@ extern     void nfs_unlock_request(struct nf
+ extern        void nfs_unlock_and_release_request(struct nfs_page *);
+ extern        struct nfs_page *nfs_page_group_lock_head(struct nfs_page *req);
+ extern        int nfs_page_group_lock_subrequests(struct nfs_page *head);
+-extern void nfs_join_page_group(struct nfs_page *head,
+-                              struct nfs_commit_info *cinfo,
+-                              struct inode *inode);
++extern        void nfs_join_page_group(struct nfs_page *head, struct inode *inode);
+ extern int nfs_page_group_lock(struct nfs_page *);
+ extern void nfs_page_group_unlock(struct nfs_page *);
+ extern bool nfs_page_group_sync_on_bit(struct nfs_page *, unsigned int);
diff --git a/review-6.1/series b/review-6.1/series
new file mode 100644 (file)
index 0000000..db0d4ee
--- /dev/null
@@ -0,0 +1,6 @@
+revert-nfs-more-fixes-for-nfs_direct_write_reschedule_io.patch
+revert-nfs-use-the-correct-commit-info-in-nfs_join_page_group.patch
+revert-nfs-more-o_direct-accounting-fixes-for-error-paths.patch
+revert-nfs-fix-o_direct-locking-issues.patch
+revert-nfs-fix-error-handling-for-o_direct-write-scheduling.patch
+lib-test_meminit-fix-off-by-one-error-in-test_pages.patch