diff options
| author | Ryusuke Konishi <konishi.ryusuke@gmail.com> | 2026-10-06 17:48:25 +0900 |
|---|---|---|
| committer | Viacheslav Dubeyko <slava@dubeyko.com> | 2026-10-06 10:03:46 -0700 |
| commit | 814f5a53b4724798795b15690ff3d1c1d9ac1eb6 (patch) | |
| tree | 59d6024d73988e00ef5e43a7efa0376ec82dfd50 /scripts/Makefile.thinlto | |
| parent | d4dfe010220320801fc97ae7a6befa3aaf4cb2d1 (diff) | |
| download | linux-814f5a53b4724798795b15690ff3d1c1d9ac1eb6.tar.gz linux-814f5a53b4724798795b15690ff3d1c1d9ac1eb6.zip | |
nilfs2: fix link count underflow when removing corrupted directory
When removing an empty directory with a corrupted link count (e.g.,
i_nlink is 1 due to filesystem corruption), nilfs_rmdir() calls
drop_nlink() via nilfs_do_unlink() and then calls drop_nlink() again
on the directory inode. This second call causes an underflow of
i_nlink, triggering a kernel WARNING in drop_nlink().
Fix this issue by using clear_nlink() instead of drop_nlink() to
finalize the link count reset for the target directory in nilfs_rmdir().
Additionally, log a warning message when i_nlink is not 2 before
removing an empty directory to notify about the link count inconsistency.
Reported-by: syzbot+c388db0347b7fc88fa7a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c388db0347b7fc88fa7a
Fixes: d25006523d0b ("nilfs2: pathname operations")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
