OSDN Git Service

btrfs: qgroup: update limit info in function btrfs_run_qgroups().
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Fri, 21 Nov 2014 02:04:56 +0000 (21:04 -0500)
committerChris Mason <clm@fb.com>
Mon, 13 Apr 2015 14:52:42 +0000 (07:52 -0700)
When we commit_transaction(), qgroups in btree should be updated.
But, limit info is not considered currently. It will cause a problem
when a qgroup of a snapshot inherit the limit info from srcqgroup,
then there is an inconsistency.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/qgroup.c

index bf0702a..5d1d756 100644 (file)
@@ -2154,6 +2154,10 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans,
                if (ret)
                        fs_info->qgroup_flags |=
                                        BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
+               ret = update_qgroup_limit_item(trans, quota_root, qgroup);
+               if (ret)
+                       fs_info->qgroup_flags |=
+                                       BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
                spin_lock(&fs_info->qgroup_lock);
        }
        if (fs_info->quota_enabled)