diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b8863537d31d..1a349759efae 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4329,7 +4329,11 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) goto out_end_trans; } - btrfs_record_root_in_trans(trans, dest); + ret = btrfs_record_root_in_trans(trans, dest); + if (ret) { + btrfs_abort_transaction(trans, ret); + goto out_end_trans; + } memset(&dest->root_item.drop_progress, 0, sizeof(dest->root_item.drop_progress));