Skip to contentSkip to conversation

Linux 6.1.58

DISCUSSION Greg Kroah-Hartman 2 participants 4 messages Oct 15, 2023 – Oct 20, 2023 Stable branch

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

I'm announcing the release of the 6.1.58 kernel.

All users of the 6.1 kernel series must upgrade.

The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                 |    2 
 fs/nfs/direct.c          |  134 ++++++++++++++---------------------------------
 fs/nfs/write.c           |   23 +++-----
 include/linux/nfs_page.h |    4 -
 lib/test_meminit.c       |    2 
 5 files changed, 55 insertions(+), 110 deletions(-)

Greg Kroah-Hartman (7):
Revert "NFS: More fixes for nfs_direct_write_reschedule_io()" Revert "NFS: Use the correct commit info in nfs_join_page_group()" Revert "NFS: More O_DIRECT accounting fixes for error paths" Revert "NFS: Fix O_DIRECT locking issues"
Revert "NFS: Fix error handling for O_DIRECT write scheduling" lib/test_meminit: fix off-by-one error in test_pages() Linux 6.1.58

author maintainer
#1 lore raw
Makefile +1 -1
index b435b56594f0..ce1eec0b5010 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 6
 PATCHLEVEL = 1
-SUBLEVEL = 57
+SUBLEVEL = 58
 EXTRAVERSION =
 NAME = Curry Ramen
 
fs/nfs/direct.c +41 -93

253 lines not on this page · raw message

fs/nfs/write.c +11 -12
index 0a8aed0ac994..f41d24b54fd1 100644
@@ -58,8 +58,7 @@ static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops;
 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 nfs_page *destroy_list,
  * 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 *head, struct nfs_commit_info *cinfo,
 	 * 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 *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 *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);
include/linux/nfs_page.h +1 -3
index e39a8cf8b179..ba7e2e4b0926 100644
@@ -145,9 +145,7 @@ extern	void nfs_unlock_request(struct nfs_page *req);
 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);
lib/test_meminit.c +1 -1
index 0ae35223d773..85d8dd8e01dc 100644
@@ -93,7 +93,7 @@ static int __init test_pages(int *total_failures)
 	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();
#2 lore raw
In reply to Greg Kroah-Hartman
Quoted 22 lines · Greg Kroah-Hartman

I'm announcing the release of the 6.1.58 kernel.

All users of the 6.1 kernel series must upgrade.

The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                 |    2 
 fs/nfs/direct.c          |  134 ++++++++++++++---------------------------------
 fs/nfs/write.c           |   23 +++-----
 include/linux/nfs_page.h |    4 -
 lib/test_meminit.c       |    2 
 5 files changed, 55 insertions(+), 110 deletions(-)
Quoted 6 lines

Greg Kroah-Hartman (7):
Revert "NFS: More fixes for nfs_direct_write_reschedule_io()" Revert "NFS: Use the correct commit info in nfs_join_page_group()" Revert "NFS: More O_DIRECT accounting fixes for error paths" Revert "NFS: Fix O_DIRECT locking issues"
Revert "NFS: Fix error handling for O_DIRECT write scheduling"

FYI the problem with these NFS patch is now described in comment #4 of
https://bugzilla.kernel.org/show_bug.cgi?id=217999
which I include below. They can be reapplied if the "Fix error handling..." patch is fixed up as described.

NeilBrown

FYI the cause of this corruption is that the backport of
NFS: Fix error handling for O_DIRECT write scheduling

had an error.
The backported patch f16fd0b11f0f4d41846b5102b1656ea1fc9ac7a0 moves "pos += req_len" in nfs_direct_write_schedule_iovec() from after

    req->wb_index = pos >> PAGE_SHIFT;

to before that statement. This ->wb_index is wrong.
Possibly a better way to look at this is the use of "pos" is moved to *after* it is updated.

The upstream patch 954998b60caa8f2a3bf3abe490de6f08d283687a doesn't move the use of pos because
Commit 70e9db69f927 ("NFS: Clean up O_DIRECT request allocation")

removes the use.

v6.1.56 can be fixed with

fs/nfs/direct.c +2 -2
index 5a976fa343df..69134e11e7d0 100644
@@ -864,6 +864,8 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
                                result = PTR_ERR(req);
                                break;
                        }
+                       req->wb_index = pos >> PAGE_SHIFT;
+                       req->wb_offset = pos & ~PAGE_MASK;
 
                        if (desc.pg_error < 0) {
                                nfs_free_request(req);
@@ -883,8 +885,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
                        }
 
                        nfs_lock_request(req);
-                       req->wb_index = pos >> PAGE_SHIFT;
-                       req->wb_offset = pos & ~PAGE_MASK;
                        if (nfs_pageio_add_request(&desc, req))
                                continue;
author maintainer
#3 lore raw
Quoted 69 lines · NeilBrown
Quoted 22 lines · Greg Kroah-Hartman

I'm announcing the release of the 6.1.58 kernel.

All users of the 6.1 kernel series must upgrade.

The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                 |    2 
 fs/nfs/direct.c          |  134 ++++++++++++++---------------------------------
 fs/nfs/write.c           |   23 +++-----
 include/linux/nfs_page.h |    4 -
 lib/test_meminit.c       |    2 
 5 files changed, 55 insertions(+), 110 deletions(-)
Quoted 6 lines

Greg Kroah-Hartman (7):
Revert "NFS: More fixes for nfs_direct_write_reschedule_io()" Revert "NFS: Use the correct commit info in nfs_join_page_group()" Revert "NFS: More O_DIRECT accounting fixes for error paths" Revert "NFS: Fix O_DIRECT locking issues"
Revert "NFS: Fix error handling for O_DIRECT write scheduling"

FYI the problem with these NFS patch is now described in comment #4 of
https://bugzilla.kernel.org/show_bug.cgi?id=217999
which I include below. They can be reapplied if the "Fix error handling..." patch is fixed up as described.

NeilBrown

FYI the cause of this corruption is that the backport of
NFS: Fix error handling for O_DIRECT write scheduling

had an error.
The backported patch f16fd0b11f0f4d41846b5102b1656ea1fc9ac7a0 moves "pos += req_len" in nfs_direct_write_schedule_iovec() from after

    req->wb_index = pos >> PAGE_SHIFT;

to before that statement. This ->wb_index is wrong.
Possibly a better way to look at this is the use of "pos" is moved to *after* it is updated.

The upstream patch 954998b60caa8f2a3bf3abe490de6f08d283687a doesn't move the use of pos because
Commit 70e9db69f927 ("NFS: Clean up O_DIRECT request allocation")

removes the use.

v6.1.56 can be fixed with

fs/nfs/direct.c +2 -0
index 5a976fa343df..69134e11e7d0 100644
@@ -864,6 +864,8 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
                                result = PTR_ERR(req);
                                break;
                        }
+                       req->wb_index = pos >> PAGE_SHIFT;
+                       req->wb_offset = pos & ~PAGE_MASK;
 
                        if (desc.pg_error < 0) {
                                nfs_free_request(req);

fs/nfs/direct.c static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, · line 889

Quoted 7 lines
fs/nfs/direct.c +0 -2
@@ -883,8 +885,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
                        }
 
                        nfs_lock_request(req);
-                       req->wb_index = pos >> PAGE_SHIFT;
-                       req->wb_offset = pos & ~PAGE_MASK;
                        if (nfs_pageio_add_request(&desc, req))
                                continue;

Nice, thanks for digging into this. I think I'll leave this be for now, until someone submits a fully backported, and tested, series that they are willing to say actually works :)

thanks,

greg k-h