Skip to content

Commit e8ed78f

Browse files
helen-fornazieraalexandrovich
authored andcommitted
fs/ntfs3: call _ntfs_bad_inode() when failing to rename
It is safe to call _ntfs_bad_inode on live inodes since: commit 519b078 ("fs/ntfs3: Exclude call make_bad_inode for live nodes.") The WARN_ON was added when it wasn't safe by: commit d99208b ("fs/ntfs3: cancle set bad inode after removing name fails") Replace the WARN_ON with a call to _ntfs_bad_inode() to prevent further operations on the inconsistent inode. Reported-by: syzbot+4d8e30dbafb5c1260479@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=4d8e30dbafb5c1260479 Fixes: 519b078 ("fs/ntfs3: Exclude call make_bad_inode for live nodes.") Signed-off-by: Helen Koike <koike@igalia.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 36c7276 commit e8ed78f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ntfs3/frecord.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,8 +2800,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
28002800
err = ni_add_name(new_dir_ni, ni, new_de);
28012801
if (!err) {
28022802
err = ni_remove_name(dir_ni, ni, de, &de2, &undo);
2803-
WARN_ON(err &&
2804-
ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo));
2803+
if (err && ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo))
2804+
_ntfs_bad_inode(&ni->vfs_inode);
28052805
}
28062806

28072807
/*

0 commit comments

Comments
 (0)