From: Josef Bacik Date: Fri, 12 Mar 2021 20:25:02 +0000 (-0500) Subject: btrfs: handle btrfs_record_root_in_trans failure in btrfs_rename_exchange X-Git-Tag: accepted/tizen/unified/20230118.172025~7052^2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00aa8e87c9dc63bf145bee00d890198cf7c45a24;p=platform%2Fkernel%2Flinux-rpi.git btrfs: handle btrfs_record_root_in_trans failure in btrfs_rename_exchange btrfs_record_root_in_trans will return errors in the future, so handle the error properly in btrfs_rename_exchange. 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 41517d1..179ffb9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9108,8 +9108,11 @@ static int btrfs_rename_exchange(struct inode *old_dir, goto out_notrans; } - if (dest != root) - btrfs_record_root_in_trans(trans, dest); + if (dest != root) { + ret = btrfs_record_root_in_trans(trans, dest); + if (ret) + goto out_fail; + } /* * We need to find a free sequence number both in the source and