From: Josef Bacik Date: Fri, 12 Mar 2021 20:25:04 +0000 (-0500) Subject: btrfs: handle btrfs_record_root_in_trans failure in btrfs_delete_subvolume X-Git-Tag: accepted/tizen/unified/20230118.172025~7052^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2731f5186ba8e641515a01a1016b88f09b34777d;p=platform%2Fkernel%2Flinux-rpi.git btrfs: handle btrfs_record_root_in_trans failure in btrfs_delete_subvolume btrfs_record_root_in_trans will return errors in the future, so handle the error properly in btrfs_delete_subvolume. Reviewed-by: Qu Wenruo Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b886353..1a34975 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));