summaryrefslogtreecommitdiff
path: root/fs/erofs/zdata.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2023-04-07 22:17:04 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-04-17 01:15:50 +0800
commiteb2c5e41be1495cf7a20ff49df473b1c45b82e77 (patch)
tree939ee6fc72404440e86150d19e797acbcc1e7d3b /fs/erofs/zdata.c
parentcb9bce79514392a9a216ff67148e05e2d72c28bd (diff)
erofs: keep meta inode into erofs_buf
So that erofs_read_metadata() can read metadata from other inodes (e.g. packed inode) as well. Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Acked-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230407141710.113882-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/zdata.c')
-rw-r--r--fs/erofs/zdata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index a90d37c7bdd7..34944e400037 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -939,12 +939,12 @@ static int z_erofs_read_fragment(struct inode *inode, erofs_off_t pos,
if (!packed_inode)
return -EFSCORRUPTED;
+ buf.inode = packed_inode;
pos += EROFS_I(inode)->z_fragmentoff;
for (i = 0; i < len; i += cnt) {
cnt = min_t(unsigned int, len - i,
sb->s_blocksize - erofs_blkoff(sb, pos));
- src = erofs_bread(&buf, packed_inode,
- erofs_blknr(sb, pos), EROFS_KMAP);
+ src = erofs_bread(&buf, erofs_blknr(sb, pos), EROFS_KMAP);
if (IS_ERR(src)) {
erofs_put_metabuf(&buf);
return PTR_ERR(src);