mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
fsck.f2fs: fix incorrect block_addr of node/meta
Fix incorrect block_addr of node or meta inode into 0x1 during build_nat_area_bitmap(). Signed-off-by: Junling Zheng <zhengjunling@huawei.com> Signed-off-by: Liu Xue <liuxueliu.liu@huawei.com> Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
bc6f686893
commit
9b09631c8f
@ -1665,7 +1665,14 @@ void build_nat_area_bitmap(struct f2fs_sb_info *sbi)
|
||||
|
||||
if ((nid + i) == F2FS_NODE_INO(sbi) ||
|
||||
(nid + i) == F2FS_META_INO(sbi)) {
|
||||
ASSERT(nat_block->entries[i].block_addr != 0x0);
|
||||
/* block_addr of node/meta inode should be 0x1 */
|
||||
if (le32_to_cpu(nat_block->entries[i].block_addr) != 0x1) {
|
||||
FIX_MSG("ino: 0x%x node/meta inode, block_addr= 0x%x -> 0x1",
|
||||
nid + i, le32_to_cpu(nat_block->entries[i].block_addr));
|
||||
nat_block->entries[i].block_addr = cpu_to_le32(0x1);
|
||||
ret = dev_write_block(nat_block, block_addr);
|
||||
ASSERT(ret >= 0);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user