Skip to content

Commit

Permalink
nyuds-image: only set root ino for rafs v5
Browse files Browse the repository at this point in the history
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
  • Loading branch information
changweige committed Sep 30, 2022
1 parent 14936eb commit 5193fdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/nydus-image/core/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ impl Bootstrap {
tree: &mut Tree,
) -> Result<()> {
tree.node.index = RAFS_ROOT_INODE;
tree.node.inode.set_ino(RAFS_ROOT_INODE);
// Rafs v6 root inode number can't be decided until the end of dumping.
if ctx.fs_version.is_v5() {
tree.node.inode.set_ino(RAFS_ROOT_INODE);
}
// Filesystem walking skips root inode within subsequent while loop, however, we allow
// user to pass the source root as prefetch hint. Check it here.
ctx.prefetch.insert_if_need(&tree.node);
Expand Down

0 comments on commit 5193fdf

Please sign in to comment.