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]
Date:   Wed, 8 Feb 2023 15:21:18 +0800
From:   Jia Zhu <zhujia.zj@...edance.com>
To:     Jingbo Xu <jefflexu@...ux.alibaba.com>, xiang@...nel.org,
        chao@...nel.org, linux-erofs@...ts.ozlabs.org
Cc:     huyue2@...lpad.com, linux-kernel@...r.kernel.org
Subject: Re: [External] [PATCH 1/4] erofs: remove unused device mapping in
 meta routine



在 2023/2/8 15:16, Jingbo Xu 写道:
> Currently metadata is always on bootstrap, and thus device mapping is
> not needed so far.  Remove the redundant device mapping in the meta
> routine.
> 
> Signed-off-by: Jingbo Xu <jefflexu@...ux.alibaba.com>

Reviewed-by: Jia Zhu <zhujia.zj@...edance.com>

> ---
>   fs/erofs/fscache.c | 17 ++++-------------
>   1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
> index 014e20962376..03de4dc99302 100644
> --- a/fs/erofs/fscache.c
> +++ b/fs/erofs/fscache.c
> @@ -164,18 +164,8 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie,
>   static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)
>   {
>   	int ret;
> -	struct super_block *sb = folio_mapping(folio)->host->i_sb;
> +	struct erofs_fscache *ctx = folio_mapping(folio)->host->i_private;
>   	struct erofs_fscache_request *req;
> -	struct erofs_map_dev mdev = {
> -		.m_deviceid = 0,
> -		.m_pa = folio_pos(folio),
> -	};
> -
> -	ret = erofs_map_dev(sb, &mdev);
> -	if (ret) {
> -		folio_unlock(folio);
> -		return ret;
> -	}
>   
>   	req = erofs_fscache_req_alloc(folio_mapping(folio),
>   				folio_pos(folio), folio_size(folio));
> @@ -184,8 +174,8 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)
>   		return PTR_ERR(req);
>   	}
>   
> -	ret = erofs_fscache_read_folios_async(mdev.m_fscache->cookie,
> -				req, mdev.m_pa, folio_size(folio));
> +	ret = erofs_fscache_read_folios_async(ctx->cookie, req,
> +				folio_pos(folio), folio_size(folio));
>   	if (ret)
>   		req->error = ret;
>   
> @@ -469,6 +459,7 @@ struct erofs_fscache *erofs_fscache_acquire_cookie(struct super_block *sb,
>   		inode->i_size = OFFSET_MAX;
>   		inode->i_mapping->a_ops = &erofs_fscache_meta_aops;
>   		mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
> +		inode->i_private = ctx;
>   
>   		ctx->inode = inode;
>   	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ