mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-22 02:20:40 +00:00
btrfs: abort transaction if we fail to update the delayed inode
[ Upstream commit 04587ad9be
]
If we fail to update the delayed inode we need to abort the transaction,
because we could leave an inode with the improper counts or some other
such corruption behind.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e0ffb169a3
commit
8d05e30c97
1 changed files with 8 additions and 0 deletions
|
@ -1073,6 +1073,14 @@ static int __btrfs_update_delayed_inode(struct btrfs_trans_handle *trans,
|
|||
btrfs_delayed_inode_release_metadata(fs_info, node, (ret < 0));
|
||||
btrfs_release_delayed_inode(node);
|
||||
|
||||
/*
|
||||
* If we fail to update the delayed inode we need to abort the
|
||||
* transaction, because we could leave the inode with the improper
|
||||
* counts behind.
|
||||
*/
|
||||
if (ret && ret != -ENOENT)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
|
||||
return ret;
|
||||
|
||||
search:
|
||||
|
|
Loading…
Reference in a new issue