From: Josef Bacik Date: Fri, 12 Mar 2021 20:25:09 +0000 (-0500) Subject: btrfs: handle record_root_in_trans failure in qgroup_account_snapshot X-Git-Tag: accepted/tizen/unified/20230118.172025~7052^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c442d22466074b8290d89ddda2c2edbf8be1eaf;p=platform%2Fkernel%2Flinux-rpi.git btrfs: handle record_root_in_trans failure in qgroup_account_snapshot record_root_in_trans can fail currently, so handle this failure properly. Reviewed-by: Qu Wenruo Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index deb1864..6362549 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1454,7 +1454,9 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, * recorded root will never be updated again, causing an outdated root * item. */ - record_root_in_trans(trans, src, 1); + ret = record_root_in_trans(trans, src, 1); + if (ret) + return ret; /* * btrfs_qgroup_inherit relies on a consistent view of the usage for the @@ -1523,7 +1525,7 @@ out: * insert_dir_item() */ if (!ret) - record_root_in_trans(trans, parent, 1); + ret = record_root_in_trans(trans, parent, 1); return ret; }