Re: [PATCH 2/5] buffer: Calculate block number inside folio_init_buffers()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 08, 2023 at 03:59:51PM +0100, Pankaj Raghav wrote:
> On Tue, Nov 07, 2023 at 07:41:49PM +0000, Matthew Wilcox (Oracle) wrote:
> > 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().
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
> 
> Not totally related to the patch but even though the variable "block"
> is sector_t type, but it represents the block number in logical block
> size unit of the device? My mind directly went to sector_t being 512
> bytes blocks.

Yes; it's confusing.  buffer_heads are always created for the logical
block size that the filesystem mounted on the device needs.  It's
never for the fixed-size 512 byte sectors (but might happen to be
512 bytes if that's what the fs has set the block device to).

> But the math checks out.
> Reviewed-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>

Thanks!




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux