aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/qgroup.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 65b62c467e28..b497498484be 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1959,6 +1959,7 @@ static int qgroup_subtree_accounting(struct btrfs_trans_handle *trans,
1959 struct btrfs_qgroup_list *glist; 1959 struct btrfs_qgroup_list *glist;
1960 struct ulist *parents; 1960 struct ulist *parents;
1961 int ret = 0; 1961 int ret = 0;
1962 int err;
1962 struct btrfs_qgroup *qg; 1963 struct btrfs_qgroup *qg;
1963 u64 root_obj = 0; 1964 u64 root_obj = 0;
1964 struct seq_list elem = {}; 1965 struct seq_list elem = {};
@@ -2013,10 +2014,12 @@ static int qgroup_subtree_accounting(struct btrfs_trans_handle *trans,
2013 * while adding parents of the parents to our ulist. 2014 * while adding parents of the parents to our ulist.
2014 */ 2015 */
2015 list_for_each_entry(glist, &qg->groups, next_group) { 2016 list_for_each_entry(glist, &qg->groups, next_group) {
2016 ret = ulist_add(parents, glist->group->qgroupid, 2017 err = ulist_add(parents, glist->group->qgroupid,
2017 ptr_to_u64(glist->group), GFP_ATOMIC); 2018 ptr_to_u64(glist->group), GFP_ATOMIC);
2018 if (ret < 0) 2019 if (err < 0) {
2020 ret = err;
2019 goto out_unlock; 2021 goto out_unlock;
2022 }
2020 } 2023 }
2021 2024
2022 ULIST_ITER_INIT(&uiter); 2025 ULIST_ITER_INIT(&uiter);
@@ -2028,10 +2031,12 @@ static int qgroup_subtree_accounting(struct btrfs_trans_handle *trans,
2028 2031
2029 /* Add any parents of the parents */ 2032 /* Add any parents of the parents */
2030 list_for_each_entry(glist, &qg->groups, next_group) { 2033 list_for_each_entry(glist, &qg->groups, next_group) {
2031 ret = ulist_add(parents, glist->group->qgroupid, 2034 err = ulist_add(parents, glist->group->qgroupid,
2032 ptr_to_u64(glist->group), GFP_ATOMIC); 2035 ptr_to_u64(glist->group), GFP_ATOMIC);
2033 if (ret < 0) 2036 if (err < 0) {
2037 ret = err;
2034 goto out_unlock; 2038 goto out_unlock;
2039 }
2035 } 2040 }
2036 } 2041 }
2037 2042