]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: fix two misuses of folio_shift()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 21 Jan 2025 05:40:51 +0000 (05:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:16 +0000 (12:54 -0700)
commitd5ca39d3369aaa2067f47ffff3a46e7e42c8c79f
tree82945e1e2b1c0dca278f6762a0fa4847fe563230
parent3ceaafa26f302781279c696dcc4b8576b69de398
btrfs: fix two misuses of folio_shift()

[ Upstream commit 01af106a076352182b2916b143fc50272600bd81 ]

It is meaningless to shift a byte count by folio_shift().  The folio index
is in units of PAGE_SIZE, not folio_size().  We can use folio_contains()
to make this work for arbitrary-order folios, so remove the assertion
that the folios are of order 0.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/extent_io.c