mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
btrfs: fix double iput() on inode after an error during orphan cleanup
commitb777d279ff
upstream. At btrfs_orphan_cleanup(), if we were able to find the inode, we do an iput() on the inode, then if btrfs_drop_verity_items() succeeds and then either btrfs_start_transaction() or btrfs_del_orphan_item() fail, we do another iput() in the respective error paths, resulting in an extra iput() on the inode. Fix this by setting inode to NULL after the first iput(), as iput() ignores a NULL inode pointer argument. Fixes:a13bb2c038
("btrfs: add missing iputs on orphan cleanup failure") CC: stable@vger.kernel.org # 6.4 Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a5880e69cf
commit
40150056dc
1 changed files with 1 additions and 0 deletions
|
@ -3618,6 +3618,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
|
|||
if (inode) {
|
||||
ret = btrfs_drop_verity_items(BTRFS_I(inode));
|
||||
iput(inode);
|
||||
inode = NULL;
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue