projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c42c0ff
)
erofs: fix missing unmap if z_erofs_get_extent_compressedlen() fails
author
Gao Xiang
<hsiangkao@linux.alibaba.com>
Mon, 5 Dec 2022 15:00:49 +0000
(23:00 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Wed, 7 Dec 2022 02:56:31 +0000
(10:56 +0800)
Otherwise, meta buffers could be leaked.
Fixes: cec6e93beadf ("erofs: support parsing big pcluster compress indexes")
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20221205150050.47784-1-hsiangkao@linux.alibaba.com
fs/erofs/zmap.c
patch
|
blob
|
history
diff --git
a/fs/erofs/zmap.c
b/fs/erofs/zmap.c
index 749a5ac943f4f1e4fea9dc3553ba71aa476192c0..98eff1259de4da6e667a8d6bf1669a22bf6aefb0 100644
(file)
--- 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;
}