fs/ntfs3: call _ntfs_bad_inode() when failing to rename
PATCH 1/1 fs/ntfs3: call _ntfs_bad_inode() when failing to rename
It is safe to call _ntfs_bad_inode on live inodes since:
commit 519b078998ce ("fs/ntfs3: Exclude call make_bad_inode for live nodes.")
The WARN_ON was added when it wasn't safe by:
commit d99208b91933 ("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.
--- fs/ntfs3/frecord.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ntfs3/frecord.c +2 -2
@@ -2800,8 +2800,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni, err =ni_add_name (new_dir_ni, ni, new_de);if (!err) { err =ni_remove_name (dir_ni, ni, de, &de2, &undo); -WARN_ON (err && -ni_remove_name (new_dir_ni, ni, new_de, &de2, &undo)); +if (err &&ni_remove_name (new_dir_ni, ni, new_de, &de2, &undo)) +_ntfs_bad_inode (&ni->vfs_inode); }/*
Signature · 1 line
2.53.0
Konstantin Komarov
maintainerQuoted 22 lines · Helen Koike
It is safe to call
_ntfs_bad_inodeon live inodes since:
commit519b078998ce("fs/ntfs3: Exclude callmake_bad_inodefor live nodes.")The
WARN_ONwas added when it wasn't safe by:
commitd99208b91933("fs/ntfs3: cancle set bad inode after removing name fails")Replace the
WARN_ONwith a call to_ntfs_bad_inode()to prevent further operations on the inconsistent inode.Reported-by [email protected]Fixes 519b078998ce ("fs/ntfs3: Exclude call make_bad_inode for live nodes.")Signed-off-by Helen Koike <[email protected]>--- fs/ntfs3/frecord.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ntfs3/frecord.c +0
-0
fs/ntfs3/frecord.c int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni, · line 2807
Quoted 10 lines
fs/ntfs3/frecord.c +2
-2@@ -2800,8 +2800,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni, err =ni_add_name (new_dir_ni, ni, new_de);if (!err) { err =ni_remove_name (dir_ni, ni, de, &de2, &undo); -WARN_ON (err && -ni_remove_name (new_dir_ni, ni, new_de, &de2, &undo)); +if (err &&ni_remove_name (new_dir_ni, ni, new_de, &de2, &undo)) +_ntfs_bad_inode (&ni->vfs_inode); }/*
Hello,
Your patch was applied, thanks.
Regards,
Konstantin