From: Dongsheng Yang Date: Fri, 21 Nov 2014 01:14:38 +0000 (-0500) Subject: btrfs: qgroup: inherit limit info from srcgroup in creating snapshot. X-Git-Tag: v4.1-rc1~30^2~18 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3eeb4d597efc9e068902057f1bd040cffc69e9e6;p=karo-tx-linux.git btrfs: qgroup: inherit limit info from srcgroup in creating snapshot. Currently, when we snapshot a subvol, snapshot will not copy the limits from srcqgroup. This patch make the qgroup in snapshot inherit the limit info when create a snapshot. Signed-off-by: Dongsheng Yang Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 37188c6b408d..34c2753fa4e1 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -2302,6 +2302,14 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, dstgroup->excl_cmpr = level_size; srcgroup->excl = level_size; srcgroup->excl_cmpr = level_size; + + /* inherit the limit info */ + dstgroup->lim_flags = srcgroup->lim_flags; + dstgroup->max_rfer = srcgroup->max_rfer; + dstgroup->max_excl = srcgroup->max_excl; + dstgroup->rsv_rfer = srcgroup->rsv_rfer; + dstgroup->rsv_excl = srcgroup->rsv_excl; + qgroup_dirty(fs_info, dstgroup); qgroup_dirty(fs_info, srcgroup); }