summaryrefslogtreecommitdiff
path: root/fs/erofs/dir.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/dir.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/dir.c')
-rw-r--r--fs/erofs/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c
index 963bbed0b699..b80abec0531a 100644
--- a/fs/erofs/dir.c
+++ b/fs/erofs/dir.c
@@ -58,11 +58,12 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
int err = 0;
bool initial = true;
+ buf.inode = dir;
while (ctx->pos < dirsize) {
struct erofs_dirent *de;
unsigned int nameoff, maxsize;
- de = erofs_bread(&buf, dir, i, EROFS_KMAP);
+ de = erofs_bread(&buf, i, EROFS_KMAP);
if (IS_ERR(de)) {
erofs_err(sb, "fail to readdir of logical block %u of nid %llu",
i, EROFS_I(dir)->nid);