mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
fsck.f2fs: do not access nat etnries in ckpt before initialization
ckpt->entries is initialized by fsck_init(), but we tried to access it during f2fs_do_mount(). The call sequence is: - f2fs_do_mount - record_fsync_data - traverse_dnodes - do_record_fsync_data - ADDRS_PER_PAGE - get_node_info - node_info_from_raw_nat(fsck->entries[nid]) - do_fsck - fsck_init - build_nat_area_bitmap - fsck->entries = calloc(fsck->nr_nat_entries); Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
8c420512fc
commit
65e1898bbe
@ -2126,7 +2126,7 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t nid, struct node_info *ni)
|
||||
struct f2fs_nat_entry raw_nat;
|
||||
|
||||
ni->nid = nid;
|
||||
if (c.func == FSCK) {
|
||||
if (c.func == FSCK && F2FS_FSCK(sbi)->nr_nat_entries) {
|
||||
node_info_from_raw_nat(ni, &(F2FS_FSCK(sbi)->entries[nid]));
|
||||
if (ni->blk_addr)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user