Skip to content

Commit 8084419

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
buffer: cast block to loff_t before shifting it
While sector_t is always defined as a u64 today, that hasn't always been the case and it might not always be the same size as loff_t in the future. Link: https://lkml.kernel.org/r/20231109210608.2252323-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Hannes Reinecke <hare@suse.de> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Pankaj Raghav <p.raghav@samsung.com> Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 5f3bd90 commit 8084419

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@ static int
20082008
iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
20092009
const struct iomap *iomap)
20102010
{
2011-
loff_t offset = block << inode->i_blkbits;
2011+
loff_t offset = (loff_t)block << inode->i_blkbits;
20122012

20132013
bh->b_bdev = iomap->bdev;
20142014

0 commit comments

Comments
 (0)