f2fs-tools: fix to skip block allocation for fsynced data
authorChao Yu <yuchao0@huawei.com>
Wed, 14 Aug 2019 08:48:55 +0000 (16:48 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Aug 2019 21:51:05 +0000 (14:51 -0700)
commitde7bcc843a0b86cd59924c44e146ce773cd879d0
tree6319b3d39de8f10d874b67f681c603caf6672488
parentaa374eff7e8baa174ec2882743b05c73d0760811
f2fs-tools: fix to skip block allocation for fsynced data

Previously, we don't allow block allocation on unclean umounted image,
result in failing to repair quota system file.

In this patch, we port most recovery codes from kernel to userspace
tools, so that on unclean image, during fsck initialization, we will
record all data/node block address we may recover in kernel, and
then during allocation of quota file repair, we can skip those blocks
to avoid block use conflict.

Eventually, if free space is enough, we can repair the quota system
file on an unclean umounted image.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: remove unnecessary parameter]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/f2fs.h
fsck/fsck.h
fsck/mount.c
fsck/node.c
fsck/node.h
fsck/segment.c