public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.14] orangefs: adjust counting code to recover from 665575cf
@ 2025-06-04 14:34 hubcap
  2025-06-04 14:44 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: hubcap @ 2025-06-04 14:34 UTC (permalink / raw)
  To: stable; +Cc: Mike Marshall, hubcapsc

From: Mike Marshall <hubcap@omnibond.com>

A late commit to 6.14-rc7 (665575cf) broke orangefs. I made a patch that
fixes orangefs in 6.15, but some pagecache/folio code got pulled into
6.15 that causes my 6.15 patch not to apply to 6.14. Here is a tested
6.14 flavored patch that was never upstream that I hope can get applied
to 6.14-stable...

---
 fs/orangefs/inode.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index aae6d2b8767d..3e8ce0fea4d7 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -32,12 +32,13 @@ static int orangefs_writepage_locked(struct page *page,
 	len = i_size_read(inode);
 	if (PagePrivate(page)) {
 		wr = (struct orangefs_write_range *)page_private(page);
-		WARN_ON(wr->pos >= len);
 		off = wr->pos;
-		if (off + wr->len > len)
+		if ((off + wr->len > len) && (off <= len))
 			wlen = len - off;
 		else
 			wlen = wr->len;
+		if (wlen == 0)
+			wlen = wr->len;
 	} else {
 		WARN_ON(1);
 		off = page_offset(page);
@@ -46,8 +47,6 @@ static int orangefs_writepage_locked(struct page *page,
 		else
 			wlen = PAGE_SIZE;
 	}
-	/* Should've been handled in orangefs_invalidate_folio. */
-	WARN_ON(off == len || off + wlen > len);
 
 	WARN_ON(wlen == 0);
 	bvec_set_page(&bv, page, wlen, off % PAGE_SIZE);
@@ -341,6 +340,8 @@ static int orangefs_write_begin(struct file *file,
 			wr->len += len;
 			goto okay;
 		} else {
+			wr->pos = pos;
+			wr->len = len;
 			ret = orangefs_launder_folio(folio);
 			if (ret)
 				return ret;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6.14] orangefs: adjust counting code to recover from 665575cf
  2025-06-04 14:34 hubcap
@ 2025-06-04 14:44 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2025-06-04 14:44 UTC (permalink / raw)
  To: hubcap; +Cc: stable, Mike Marshall, hubcapsc

On Wed, Jun 04, 2025 at 10:34:02AM -0400, hubcap@kernel.org wrote:
> From: Mike Marshall <hubcap@omnibond.com>
> 
> A late commit to 6.14-rc7 (665575cf) broke orangefs. I made a patch that
> fixes orangefs in 6.15, but some pagecache/folio code got pulled into
> 6.15 that causes my 6.15 patch not to apply to 6.14. Here is a tested
> 6.14 flavored patch that was never upstream that I hope can get applied
> to 6.14-stable...

Can you make a real changelog saying what this is, AND provide a
signed-off-by line like a normal patch?  As is, I can't take this (nor
would you want me to...)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 6.14] orangefs: adjust counting code to recover from 665575cf
@ 2025-06-04 15:23 hubcap
  0 siblings, 0 replies; 3+ messages in thread
From: hubcap @ 2025-06-04 15:23 UTC (permalink / raw)
  To: stable; +Cc: Mike Marshall, hubcapsc

From: Mike Marshall <hubcap@omnibond.com>

A late commit to 6.14-rc7 (665575cf) broke orangefs. This is a several line
adjustment to some counters needed to keep orangefs from deadlocking
when writing page cache data out to the filesystem. 

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
---
 fs/orangefs/inode.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index aae6d2b8767d..3e8ce0fea4d7 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -32,12 +32,13 @@ static int orangefs_writepage_locked(struct page *page,
 	len = i_size_read(inode);
 	if (PagePrivate(page)) {
 		wr = (struct orangefs_write_range *)page_private(page);
-		WARN_ON(wr->pos >= len);
 		off = wr->pos;
-		if (off + wr->len > len)
+		if ((off + wr->len > len) && (off <= len))
 			wlen = len - off;
 		else
 			wlen = wr->len;
+		if (wlen == 0)
+			wlen = wr->len;
 	} else {
 		WARN_ON(1);
 		off = page_offset(page);
@@ -46,8 +47,6 @@ static int orangefs_writepage_locked(struct page *page,
 		else
 			wlen = PAGE_SIZE;
 	}
-	/* Should've been handled in orangefs_invalidate_folio. */
-	WARN_ON(off == len || off + wlen > len);
 
 	WARN_ON(wlen == 0);
 	bvec_set_page(&bv, page, wlen, off % PAGE_SIZE);
@@ -341,6 +340,8 @@ static int orangefs_write_begin(struct file *file,
 			wr->len += len;
 			goto okay;
 		} else {
+			wr->pos = pos;
+			wr->len = len;
 			ret = orangefs_launder_folio(folio);
 			if (ret)
 				return ret;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-04 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-04 15:23 [PATCH 6.14] orangefs: adjust counting code to recover from 665575cf hubcap
  -- strict thread matches above, loose matches on Subject: below --
2025-06-04 14:34 hubcap
2025-06-04 14:44 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox