fsck.f2fs: do not access nat etnries in ckpt before initialization
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 10 Dec 2019 16:42:20 +0000 (08:42 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 10 Dec 2019 16:47:33 +0000 (08:47 -0800)
commit65e1898bbed8d08024628195408049210247e12e
treeca9cbe52602008169699dfb92e1268d3a45dac3d
parent8c420512fcead6370ef2c8551411cc5ea671504c
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>
fsck/mount.c