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 bf0702a865f8fda2f2abd84931266cb52050b344..5d1d756117454e29cac6221fada6906e11db47a7 100644 (file)
@@ -2151,6 +2151,10 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans,
                list_del_init(&qgroup->dirty);
                spin_unlock(&fs_info->qgroup_lock);
                ret = update_qgroup_info_item(trans, quota_root, qgroup);
+               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;