f2fs: fix to do sanity check for sb/cp fields correctly
authorChao Yu <chao@kernel.org>
Fri, 6 Aug 2021 00:04:37 +0000 (08:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:10 +0000 (13:40 +0200)
commit74d6dfcb0f9daa0fd32368147c34cff05026eb4a
tree43364809402b99816965dbf57f2ac31696b959d7
parentce7e64e63acf42f9d1fe36ec300e56af63958814
f2fs: fix to do sanity check for sb/cp fields correctly

commit 65ddf6564843890a58ee3b18bb46ce67d96333fb upstream.

This patch fixes below problems of sb/cp sanity check:
- in sanity_check_raw_superi(), it missed to consider log header
blocks while cp_payload check.
- in f2fs_sanity_check_ckpt(), it missed to check nat_bits_blocks.

Cc: <stable@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/super.c