This series is provoked by syzbot warnings caused by corrupted directory
inode with i_nlink == 1 that passes the initial sanity check which will
only mark the filesystem as corrupted in case i_nlink == 0.
Tests:
- fio/fsmark parallel create/unlink on VM with f2fs root filesystem.
- syzbot
Changelog:
Changes from v1:
- Rename exit label in f2fs_unlink().
- Add sanity check in sanity_check_inode() and remove it from f2fs_iget()
as suggested by Chao Yu in order to detect on-disk corruption early.
https://lore.kernel.org/linux-f2fs-devel/[email protected]/T/#t
Changes from v2:
- Remove i_nlink == 0 check from sanity_check_inode.
- Wrap i_nlink == 1 in unlikely() marco.
https://lore.kernel.org/linux-f2fs-devel/[email protected]/T/#u
Nikola Z. Ivanov (2):
f2fs: Rename f2fs_unlink exit label
f2fs: Add sanity checks before unlinking and loading inodes
fs/f2fs/inode.c | 6 ++++++
fs/f2fs/namei.c | 27 +++++++++++++++++----------
2 files changed, 23 insertions(+), 10 deletions(-)
--
2.51.0
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel