From nobody Sun Feb 8 14:12:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35CA81A4355; Wed, 27 Mar 2024 12:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711542464; cv=none; b=OvhOEBWuG8G8WzVJABDioZKaRNMj9ArfpDMZsnkZdK9BQgs8ke4xeYnJ/ndEQOVR09D6mJ7emEQPRVw90A5t+EmliNLv0jQdz6boWBSnIeT3cpMqXLAyveTPevmLjf08vVK1rxQE21pAam4lzZ5o/izE9y51L5IJFRUJDJSLjKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711542464; c=relaxed/simple; bh=rPGfnLFPSavzTCZl7PBphFANNg0fEWlnqwTgfQnLpTo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Krn3bNdgfYYSCwUhh4ZjrCBYSz3KJsPIxBEi3E1toGglnEFig7kZrsHyvgvpf+Pj4G+WG5aLZpeuSW3aRA4ByNU1hOP59XfuuPIqA7IpGaSvXi6CZy6xLisVrt0G4Vjru3mhNhpP2VxJFyC+juuaHIKo1F9VMiu6dqIX4UWfTTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fjAYAPvq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fjAYAPvq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EFECC433F1; Wed, 27 Mar 2024 12:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711542464; bh=rPGfnLFPSavzTCZl7PBphFANNg0fEWlnqwTgfQnLpTo=; h=From:To:Cc:Subject:Date:From; b=fjAYAPvqhlTqnjkFmcnt1pBcZnuzFjSNa464sT3qTv+jHqgHYT9O3sSTQgv5at3PA XvpbX+wqfnyX3I1M67aBOdgrtep+EDVNK2jZUccZCbikzJJ3vjZ9GPFXZj/sZHqTMv ANmGJvfIfd3LPLTMhpGIP2pekn9kZ5rBGQxiKFEg+9IP2Pc5/Yr+hKVhBkaLTpSw5K yVnjD5u9Rex5PPHMrhi272AtQQc004v0Y1TQHi3RbofH5IZ+9fDTUi0CEqtUwEvP6l 9FPB835Ux7scyyK6jt8Q4q4zfhngzSrAx5slxdl0E74Vma6Nns6AzhsUYwemE0gcoB mf5F8pXdatrlw== From: Sasha Levin To: stable@vger.kernel.org, tonyb@cybernetics.com Cc: Greg Edwards , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: FAILED: Patch "block: Fix page refcounts for unaligned buffers in __bio_release_pages()" failed to apply to 4.19-stable tree Date: Wed, 27 Mar 2024 08:27:42 -0400 Message-ID: <20240327122742.2842138-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch below does not apply to the 4.19-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 . Thanks, Sasha Tested-by: Greg Edwards ------------------ original commit in Linus's tree ------------------ From 38b43539d64b2fa020b3b9a752a986769f87f7a6 Mon Sep 17 00:00:00 2001 From: Tony Battersby 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 Tested-by: Greg Edwards Link: https://lore.kernel.org/r/86e592a9-98d4-4cff-a646-0c0084328356@cybern= etics.com Signed-off-by: Jens Axboe --- 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_d= irty) =20 bio_for_each_folio_all(fi, bio) { struct page *page; - size_t done =3D 0; + size_t nr_pages; =20 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 =3D folio_page(fi.folio, fi.offset / PAGE_SIZE); + nr_pages =3D (fi.offset + fi.length - 1) / PAGE_SIZE - + fi.offset / PAGE_SIZE + 1; do { bio_release_page(bio, page++); - done +=3D PAGE_SIZE; - } while (done < fi.length); + } while (--nr_pages !=3D 0); } } EXPORT_SYMBOL_GPL(__bio_release_pages); --=20 2.43.0