Re: [PATCH v2 4/8] fs/mpage: use blocks_per_folio instead of blocks_per_page

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

 



On Fri, Feb 21, 2025 at 10:58:58AM -0800, Luis Chamberlain wrote:
> +++ b/fs/mpage.c
> @@ -152,6 +152,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
>  {
>  	struct folio *folio = args->folio;
>  	struct inode *inode = folio->mapping->host;
> +	const unsigned min_nrpages = mapping_min_folio_nrpages(folio->mapping);
>  	const unsigned blkbits = inode->i_blkbits;
>  	const unsigned blocks_per_folio = folio_size(folio) >> blkbits;
>  	const unsigned blocksize = 1 << blkbits;
> @@ -172,6 +173,8 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
>  
>  	/* MAX_BUF_PER_PAGE, for example */
>  	VM_BUG_ON_FOLIO(folio_test_large(folio), folio);
> +	VM_BUG_ON_FOLIO(args->nr_pages < min_nrpages, folio);
> +	VM_BUG_ON_FOLIO(!IS_ALIGNED(args->nr_pages, min_nrpages), folio);
>  
>  	if (args->is_readahead) {
>  		opf |= REQ_RAHEAD;

Also, I don't think these assertions add any value; we already assert
these things are true in other places.





[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