Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
80844194 5f3bd90d

+1 -1
+1 -1
fs/buffer.c
··· 2008 2008 iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh, 2009 2009 const struct iomap *iomap) 2010 2010 { 2011 - loff_t offset = block << inode->i_blkbits; 2011 + loff_t offset = (loff_t)block << inode->i_blkbits; 2012 2012 2013 2013 bh->b_bdev = iomap->bdev; 2014 2014