third_party_f2fs-tools/fsck
Chao Yu 979b257278 fsck.f2fs: check validity of nat journal
As reported by Aravind:

I built f2fs tools from source (at tag v1.12.0) and was able to get this backtrace in gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f8eb54 in f2fs_set_bit (nr=1041170432,
    addr=0x7fffff621010 <error: Cannot access memory at address 0x7fffff621010>) at libf2fs.c:312
312        mask = 1 << (7 - (nr & 0x07));
(gdb) where
    addr=0x7fffff621010 <error: Cannot access memory at address 0x7fffff621010>) at libf2fs.c:312

> [ 5338.040024] nats:8781, sits:6
> [ 5338.040027] F2FS-fs (sda2): Failed to initialize F2FS segment manager
> [ 5338.128893] nats:8781, sits:6
> [ 5338.128895] F2FS-fs (sda2): Failed to initialize F2FS segment manager

nat_count/nid/blkaddr recorded in journal may be corrupted, let's do
sanity check on them, skip loading invalid ones during build_node_manager().

Reported-by: Aravind R S <aravindet@gmail.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-03-27 07:02:24 -07:00
..
common.h fsck.f2fs: support quota 2017-11-06 20:07:40 -08:00
defrag.c WIP: Add partial shrinking support to f2fs 2018-11-21 11:38:23 -08:00
dict.c fsck.f2fs: support quota 2017-11-06 20:07:40 -08:00
dict.h fsck.f2fs: support quota 2017-11-06 20:07:40 -08:00
dir.c f2fs-tools: fix to reset i_gc_failures offline 2018-08-27 23:52:39 -07:00
dqblk_v2.h fsck.f2fs: support quota 2017-11-06 20:07:40 -08:00
dump.c dump.f2fs: fix incorrect endian conversion 2019-01-08 15:44:08 -08:00
f2fs.h fsck.f2fs: try to recover cp_payload from valid cp pack 2018-11-21 11:38:23 -08:00
fsck.c fsck.f2fs: check nat_bits separately from bug_on 2019-01-08 20:21:32 -08:00
fsck.h fsck.f2fs: introduce preen mode 2 2018-11-28 00:14:30 -08:00
main.c fsck.f2fs: don't ask anything on dry-run 2019-01-08 20:21:09 -08:00
Makefile.am fsck/Makefile.am, mkfs/Makefile.am: fix to make distcheck correctly 2017-11-13 21:04:23 -08:00
mkquota.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
mount.c fsck.f2fs: check validity of nat journal 2019-03-27 07:02:24 -07:00
node.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
node.h f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
quotaio_tree.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
quotaio_tree.h fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
quotaio_v2.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
quotaio_v2.h fsck.f2fs: support quota 2017-11-06 20:07:40 -08:00
quotaio.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
quotaio.h fsck.f2fs: add an option to preserve quota limits 2017-11-11 18:01:07 -08:00
resize.c f2fs-tools: introduce sb checksum 2018-11-21 11:38:23 -08:00
segment.c fsck.f2fs: don't allocate new blocks on unclean shutdown 2018-11-21 11:38:23 -08:00
sload.c WIP: Add partial shrinking support to f2fs 2018-11-21 11:38:23 -08:00
xattr.c sload.f2fs: fix memory leak 2018-11-21 11:38:23 -08:00
xattr.h f2fs-tools: build binaries in Mac 2017-11-14 19:43:48 -08:00