diff options
author | Dongsheng Yang <[email protected]> | 2014-12-12 16:44:34 +0800 |
---|---|---|
committer | Chris Mason <[email protected]> | 2015-04-13 07:52:46 -0700 |
commit | 804ca127fb93988c6a9d5f2bf4a8f1a780c9a2d0 (patch) | |
tree | ef99ed7680b2e4c47e4ae0687cc4fc6779e9c105 | |
parent | 4087cf24ae2af17f7dd9fd34e22fde816952d421 (diff) |
Btrfs: qgroup: free reserved in exceeding quota.
When we exceed quota limit in writing, we will free
some reserved extent when we need to drop but not free
account in qgroup. It means, each time we exceed quota
in writing, there will be some remain space in qg->reserved
we can not use any more. If things go on like this, the
all space will be ate up.
Signed-off-by: Dongsheng Yang <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
-rw-r--r-- | fs/btrfs/extent-tree.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2713dcbc70f7..695d5110e020 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5475,8 +5475,11 @@ out_fail: to_free = 0; } spin_unlock(&BTRFS_I(inode)->lock); - if (dropped) + if (dropped) { + if (root->fs_info->quota_enabled) + btrfs_qgroup_free(root, dropped * root->nodesize); to_free += btrfs_calc_trans_metadata_size(root, dropped); + } if (to_free) { btrfs_block_rsv_release(root, block_rsv, to_free); |