]> www.infradead.org Git - users/jedix/linux-maple.git/commit
buffer: calculate block number inside folio_init_buffers()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 9 Nov 2023 21:06:03 +0000 (21:06 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:31 +0000 (13:16 -0800)
commit5334c6480adb332e6d779aacbca43c26b56c21b1
tree9c6ee66a99dbe033fec03923ca61e8192f61ed83
parent2c68861ed127967c47eccb7b1e8d545300dcec3c
buffer: calculate block number inside folio_init_buffers()

The calculation of block from index doesn't work for devices with a block
size larger than PAGE_SIZE as we end up shifting by a negative number.
Instead, calculate the number of the first block from the folio's position
in the block device.  We no longer need to pass sizebits to
grow_dev_folio().

Link: https://lkml.kernel.org/r/20231109210608.2252323-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/buffer.c