resize.f2fs: fix wrong nat_bits migration
authorJaegeuk Kim <jaegeuk@kernel.org>
Sun, 17 Jun 2018 00:09:23 +0000 (17:09 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 29 Jun 2018 02:21:49 +0000 (19:21 -0700)
commit1c15c8d551ae9f21364dcf301804c6b7c19eb536
tree7d9ad316ac8f27d07afb932226cdbd75e4804f40
parent154bf709729ac67b786cf35df660e4895427f9a7
resize.f2fs: fix wrong nat_bits migration

When wring the last nat_bits in new checkpoint, we call write_nat_bits()
to recover the nat_bits. But, we didn't update nm_i->nat_bitmap which we can
get the up-to-date nat blocks. After sit migration, old checkpoint has no
longer valid nat blocks, resulting in wrong free nid allocation at the following
mount time.

Let's indicate new nat_blocks by adjusting nat_bitmap in nat migration.

Reported-by: Lianjun Huang <huanglianjun@vivo.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/resize.c