From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org, Chao Yu <chao@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
zhangwen@coolpad.com
Subject: Re: [PATCH 1/2] erofs: fix missing unmap if z_erofs_get_extent_compressedlen() fails
Date: Tue, 6 Dec 2022 14:22:51 +0800 [thread overview]
Message-ID: <20221206142251.00001fb4.zbestahu@gmail.com> (raw)
In-Reply-To: <20221205150050.47784-1-hsiangkao@linux.alibaba.com>
On Mon, 5 Dec 2022 23:00:49 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> Otherwise, meta buffers could be leaked.
>
> Fixes: cec6e93beadf ("erofs: support parsing big pcluster compress indexes")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
> ---
> fs/erofs/zmap.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c
> index 749a5ac943f4..98eff1259de4 100644
> --- a/fs/erofs/zmap.c
> +++ b/fs/erofs/zmap.c
> @@ -694,7 +694,7 @@ static int z_erofs_do_map_blocks(struct inode *inode,
> map->m_pa = blknr_to_addr(m.pblk);
> err = z_erofs_get_extent_compressedlen(&m, initial_lcn);
> if (err)
> - goto out;
> + goto unmap_out;
> }
>
> if (m.headtype == Z_EROFS_VLE_CLUSTER_TYPE_PLAIN) {
> @@ -718,14 +718,12 @@ static int z_erofs_do_map_blocks(struct inode *inode,
> if (!err)
> map->m_flags |= EROFS_MAP_FULL_MAPPED;
> }
> +
> unmap_out:
> erofs_unmap_metabuf(&m.map->buf);
> -
> -out:
> erofs_dbg("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o",
> __func__, map->m_la, map->m_pa,
> map->m_llen, map->m_plen, map->m_flags);
> -
> return err;
> }
>
next prev parent reply other threads:[~2022-12-06 6:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 15:00 [PATCH 1/2] erofs: fix missing unmap if z_erofs_get_extent_compressedlen() fails Gao Xiang
2022-12-05 15:00 ` [PATCH 2/2] erofs: validate the extent length for uncompressed pclusters Gao Xiang
2022-12-06 15:09 ` Chao Yu
2022-12-06 6:22 ` Yue Hu [this message]
2022-12-06 15:07 ` [PATCH 1/2] erofs: fix missing unmap if z_erofs_get_extent_compressedlen() fails Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221206142251.00001fb4.zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=chao@kernel.org \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhangwen@coolpad.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox