lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210023612.GA247374@xiangao.remote.csb>
Date:   Thu, 10 Dec 2020 10:36:12 +0800
From:   Gao Xiang <hsiangkao@...hat.com>
To:     Huang Jianan <huangjianan@...o.com>
Cc:     linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        guoweichao@...o.com, zhangshiming@...o.com
Subject: Re: [PATCH v5] erofs: avoid using generic_block_bmap

Hi Jianan,

On Wed, Dec 09, 2020 at 07:57:40PM +0800, Huang Jianan wrote:
> iblock indicates the number of i_blkbits-sized blocks rather than
> sectors.
> 
> In addition, considering buffer_head limits mapped size to 32-bits,
> should avoid using generic_block_bmap.
> 
> Fixes: 9da681e017a3 ("staging: erofs: support bmap")
> Signed-off-by: Huang Jianan <huangjianan@...o.com>
> Signed-off-by: Guo Weichao <guoweichao@...o.com>

Reviewed-by: Gao Xiang <hsiangkao@...hat.com>

Also, I think Chao has sent his Reviewed-by in the previous reply ---
so unless some major modification happens, it needs to be attached with
all new versions as a common practice...

I will apply it later to for-next, thanks for your patch!

Thanks,
Gao Xiang

> ---
>  fs/erofs/data.c | 26 +++++++-------------------
>  1 file changed, 7 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/erofs/data.c b/fs/erofs/data.c
> index 347be146884c..ea4f693bee22 100644
> --- a/fs/erofs/data.c
> +++ b/fs/erofs/data.c
> @@ -312,27 +312,12 @@ static void erofs_raw_access_readahead(struct readahead_control *rac)
>  		submit_bio(bio);
>  }
>  
> -static int erofs_get_block(struct inode *inode, sector_t iblock,
> -			   struct buffer_head *bh, int create)
> -{
> -	struct erofs_map_blocks map = {
> -		.m_la = iblock << 9,
> -	};
> -	int err;
> -
> -	err = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
> -	if (err)
> -		return err;
> -
> -	if (map.m_flags & EROFS_MAP_MAPPED)
> -		bh->b_blocknr = erofs_blknr(map.m_pa);
> -
> -	return err;
> -}
> -
>  static sector_t erofs_bmap(struct address_space *mapping, sector_t block)
>  {
>  	struct inode *inode = mapping->host;
> +	struct erofs_map_blocks map = {
> +		.m_la = blknr_to_addr(block),
> +	};
>  
>  	if (EROFS_I(inode)->datalayout == EROFS_INODE_FLAT_INLINE) {
>  		erofs_blk_t blks = i_size_read(inode) >> LOG_BLOCK_SIZE;
> @@ -341,7 +326,10 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block)
>  			return 0;
>  	}
>  
> -	return generic_block_bmap(mapping, block, erofs_get_block);
> +	if (!erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW))
> +		return erofs_blknr(map.m_pa);
> +
> +	return 0;
>  }
>  
>  /* for uncompressed (aligned) files and raw access for other files */
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ