提交 04587ad9 编写于 作者: J Josef Bacik 提交者: David Sterba

btrfs: abort transaction if we fail to update the delayed inode

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: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 bb385bed
......@@ -1051,6 +1051,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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册