* FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 6.1-stable tree
@ 2024-03-27 12:13 Sasha Levin
2024-03-27 13:54 ` Tony Battersby
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2024-03-27 12:13 UTC (permalink / raw)
To: stable, tonyb; +Cc: Greg Edwards, Jens Axboe, linux-block, linux-kernel
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 38b43539d64b2fa020b3b9a752a986769f87f7a6 Mon Sep 17 00:00:00 2001
From: Tony Battersby <tonyb@cybernetics.com>
Date: Thu, 29 Feb 2024 13:08:09 -0500
Subject: [PATCH] block: Fix page refcounts for unaligned buffers in
__bio_release_pages()
Fix an incorrect number of pages being released for buffers that do not
start at the beginning of a page.
Fixes: 1b151e2435fc ("block: Remove special-casing of compound pages")
Cc: stable@vger.kernel.org
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Tested-by: Greg Edwards <gedwards@ddn.com>
Link: https://lore.kernel.org/r/86e592a9-98d4-4cff-a646-0c0084328356@cybernetics.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
block/bio.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/bio.c b/block/bio.c
index 496867b51609f..a8b6919400270 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1153,7 +1153,7 @@ void __bio_release_pages(struct bio *bio, bool mark_dirty)
bio_for_each_folio_all(fi, bio) {
struct page *page;
- size_t done = 0;
+ size_t nr_pages;
if (mark_dirty) {
folio_lock(fi.folio);
@@ -1161,10 +1161,11 @@ void __bio_release_pages(struct bio *bio, bool mark_dirty)
folio_unlock(fi.folio);
}
page = folio_page(fi.folio, fi.offset / PAGE_SIZE);
+ nr_pages = (fi.offset + fi.length - 1) / PAGE_SIZE -
+ fi.offset / PAGE_SIZE + 1;
do {
bio_release_page(bio, page++);
- done += PAGE_SIZE;
- } while (done < fi.length);
+ } while (--nr_pages != 0);
}
}
EXPORT_SYMBOL_GPL(__bio_release_pages);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 6.1-stable tree
2024-03-27 12:13 FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 6.1-stable tree Sasha Levin
@ 2024-03-27 13:54 ` Tony Battersby
2024-03-29 13:17 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Tony Battersby @ 2024-03-27 13:54 UTC (permalink / raw)
To: Sasha Levin, stable; +Cc: Greg Edwards, Jens Axboe, linux-block, linux-kernel
On 3/27/24 08:13, Sasha Levin wrote:
> The patch below does not apply to the 6.1-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> Thanks,
> Sasha
I already sent a backport for 6.1 on March 13. 5.15 and older kernels
do not need the patch.
https://lore.kernel.org/stable/a764cc80-5b7c-4186-a66d-5957de5beee4@cybernetics.com/
Tony
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 6.1-stable tree
2024-03-27 13:54 ` Tony Battersby
@ 2024-03-29 13:17 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-03-29 13:17 UTC (permalink / raw)
To: Tony Battersby
Cc: Sasha Levin, stable, Greg Edwards, Jens Axboe, linux-block,
linux-kernel
On Wed, Mar 27, 2024 at 09:54:01AM -0400, Tony Battersby wrote:
> On 3/27/24 08:13, Sasha Levin wrote:
> > The patch below does not apply to the 6.1-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> >
> > Thanks,
> > Sasha
>
> I already sent a backport for 6.1 on March 13. 5.15 and older kernels
> do not need the patch.
>
> https://lore.kernel.org/stable/a764cc80-5b7c-4186-a66d-5957de5beee4@cybernetics.com/
Thanks, now queued up.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-29 13:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 12:13 FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 6.1-stable tree Sasha Levin
2024-03-27 13:54 ` Tony Battersby
2024-03-29 13:17 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox