* [PATCH 1/2] erofs-utils: dump: fix --path after converting erofs_get_pathname()
@ 2021-12-23 8:26 Gao Xiang
2021-12-23 8:26 ` [PATCH 2/2] erofs-utils: lib: fix --blobdev without -Eforce-chunk-indexes Gao Xiang
0 siblings, 1 reply; 3+ messages in thread
From: Gao Xiang @ 2021-12-23 8:26 UTC (permalink / raw)
To: linux-erofs; +Cc: Gao Xiang
Otherwise it reports:
$ dump.erofs --path=/ foo.erofs.img
<E> erofs: file path not found @ nid 36
Fixes: e6082718f743 ("erofs-utils: lib: add API to get pathname of EROFS inode")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
dump/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dump/main.c b/dump/main.c
index 9d05d89..0616113 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -345,7 +345,7 @@ static void erofsdump_show_fileinfo(bool show_extent)
return;
}
- err = erofs_get_pathname(dumpcfg.nid, path, sizeof(path));
+ err = erofs_get_pathname(inode.nid, path, sizeof(path));
if (err < 0) {
erofs_err("file path not found @ nid %llu", inode.nid | 0ULL);
return;
--
2.24.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] erofs-utils: lib: fix --blobdev without -Eforce-chunk-indexes
2021-12-23 8:26 [PATCH 1/2] erofs-utils: dump: fix --path after converting erofs_get_pathname() Gao Xiang
@ 2021-12-23 8:26 ` Gao Xiang
2021-12-23 8:49 ` [PATCH v2 " Gao Xiang
0 siblings, 1 reply; 3+ messages in thread
From: Gao Xiang @ 2021-12-23 8:26 UTC (permalink / raw)
To: linux-erofs; +Cc: Gao Xiang
blockmap is used by default, chunk indexes should be switched
instead if --blobdev is specified.
Fixes: 016bd812be1e ("erofs-utils: mkfs: enable block map chunk format")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
lib/blobchunk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 5e9a88a..2e06b0c 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -113,7 +113,7 @@ int erofs_blob_write_chunk_indexes(struct erofs_inode *inode,
if (multidev) {
idx.device_id = 1;
- inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
+ DBG_BUGON(inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES);
} else {
base_blkaddr = remapped_base;
}
@@ -171,6 +171,8 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode)
int fd, ret;
inode->u.chunkformat |= inode->u.chunkbits - LOG_BLOCK_SIZE;
+ if (multidev)
+ inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
if (inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
unit = sizeof(struct erofs_inode_chunk_index);
--
2.24.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] erofs-utils: lib: fix --blobdev without -Eforce-chunk-indexes
2021-12-23 8:26 ` [PATCH 2/2] erofs-utils: lib: fix --blobdev without -Eforce-chunk-indexes Gao Xiang
@ 2021-12-23 8:49 ` Gao Xiang
0 siblings, 0 replies; 3+ messages in thread
From: Gao Xiang @ 2021-12-23 8:49 UTC (permalink / raw)
To: linux-erofs; +Cc: Gao Xiang
blockmap is used by default, chunk indexes should be switched
instead if --blobdev is specified.
Fixes: 016bd812be1e ("erofs-utils: mkfs: enable block map chunk format")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
lib/blobchunk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 5e9a88a..2e06b0c 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -113,7 +113,7 @@ int erofs_blob_write_chunk_indexes(struct erofs_inode *inode,
if (multidev) {
idx.device_id = 1;
- inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
+ DBG_BUGON(!(inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES));
} else {
base_blkaddr = remapped_base;
}
@@ -171,6 +171,8 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode)
int fd, ret;
inode->u.chunkformat |= inode->u.chunkbits - LOG_BLOCK_SIZE;
+ if (multidev)
+ inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
if (inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
unit = sizeof(struct erofs_inode_chunk_index);
--
2.24.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-23 8:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 8:26 [PATCH 1/2] erofs-utils: dump: fix --path after converting erofs_get_pathname() Gao Xiang
2021-12-23 8:26 ` [PATCH 2/2] erofs-utils: lib: fix --blobdev without -Eforce-chunk-indexes Gao Xiang
2021-12-23 8:49 ` [PATCH v2 " Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.