reiserfs: only call unlock_new_inode() if I_NEW
PATCH 1/1 reiserfs: only call unlock_new_inode() if I_NEW
From: Eric Biggers <[email protected]>
unlock_new_inode() is only meant to be called after a new inode has already been inserted into the hash table. But reiserfs_new_inode() can call it even before it has inserted the inode, triggering the WARNING in unlock_new_inode(). Fix this by only calling unlock_new_inode() if the inode has the I_NEW flag set, indicating that it's in the table.
This addresses the syzbot report "WARNING in unlock_new_inode"
(https://syzkaller.appspot.com/bug?extid=187510916eb6a14598f7).
--- fs/reiserfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/reiserfs/inode.c +2 -1
@@ -2163,7 +2163,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, out_inserted_sd:clear_nlink (inode); th->t_trans_id =0 ;/* so the caller can't use this handle later */ -unlock_new_inode (inode);/* OK to do even if we hadn't locked it */ +if (inode->i_state &I_NEW ) +unlock_new_inode (inode);iput (inode);return err; }
Signature · 1 line
2.27.0
Quoted 8 lines · Eric Biggers
From: Eric Biggers <[email protected]>
unlock_new_inode()is only meant to be called after a new inode has already been inserted into the hash table. Butreiserfs_new_inode()can call it even before it has inserted the inode, triggering the WARNING inunlock_new_inode(). Fix this by only callingunlock_new_inode()if the inode has theI_NEWflag set, indicating that it's in the table.
Quoted 5 lines
This addresses the syzbot report "WARNING in
unlock_new_inode"
(https://syzkaller.appspot.com/bug?extid=187510916eb6a14598f7).Reported-by [email protected]Signed-off-by Eric Biggers <[email protected]>
Anyone interested in taking this patch?
- Eric
Quoted 9 lines · Eric Biggers
Quoted 8 lines · Eric Biggers
From: Eric Biggers <[email protected]>
unlock_new_inode()is only meant to be called after a new inode has already been inserted into the hash table. Butreiserfs_new_inode()can call it even before it has inserted the inode, triggering the WARNING inunlock_new_inode(). Fix this by only callingunlock_new_inode()if the inode has theI_NEWflag set, indicating that it's in the table.
Quoted 7 lines
Quoted 5 lines
This addresses the syzbot report "WARNING in
unlock_new_inode"
(https://syzkaller.appspot.com/bug?extid=187510916eb6a14598f7).Reported-by [email protected]Signed-off-by Eric Biggers <[email protected]>Anyone interested in taking this patch?
Jan, you seem to be taking some reiserfs patches... Any interest in taking this one?
- Eric
Jan Kara
reviewerQuoted 13 lines · Eric Biggers
Quoted 12 lines · Eric Biggers
Quoted 11 lines · Eric Biggers
From: Eric Biggers <[email protected]>
unlock_new_inode()is only meant to be called after a new inode has already been inserted into the hash table. Butreiserfs_new_inode()can call it even before it has inserted the inode, triggering the WARNING inunlock_new_inode(). Fix this by only callingunlock_new_inode()if the inode has theI_NEWflag set, indicating that it's in the table.This addresses the syzbot report "WARNING in
unlock_new_inode"
(https://syzkaller.appspot.com/bug?extid=187510916eb6a14598f7).
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Reported-by [email protected]Signed-off-by Eric Biggers <[email protected]>Anyone interested in taking this patch?
Jan, you seem to be taking some reiserfs patches... Any interest in taking this one?
Sure, the patch looks good to me so I've added it to my tree. Thanks!
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR