mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
quota: extend quota for dataset
This patch relax the quota limitation for dataset by around 3%. What this means is that user can write more data then the quota is set to. However thanks to that we can get more stable bandwidth, in case when we are overwriting data in-place, and not consuming any additional space. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Signed-off-by: Mariusz Zaborski <oshogbo@vexillium.org> Sponsored-by: Zededa Inc. Sponsored-by: Klara Inc. Closes #13839
This commit is contained in:
parent
dc56c673e3
commit
8af08a69cd
@ -1268,6 +1268,7 @@ dsl_dir_tempreserve_impl(dsl_dir_t *dd, uint64_t asize, boolean_t netfree,
|
|||||||
uint64_t quota;
|
uint64_t quota;
|
||||||
struct tempreserve *tr;
|
struct tempreserve *tr;
|
||||||
int retval;
|
int retval;
|
||||||
|
uint64_t ext_quota;
|
||||||
uint64_t ref_rsrv;
|
uint64_t ref_rsrv;
|
||||||
|
|
||||||
top_of_function:
|
top_of_function:
|
||||||
@ -1343,7 +1344,16 @@ top_of_function:
|
|||||||
* on-disk is over quota and there are no pending changes
|
* on-disk is over quota and there are no pending changes
|
||||||
* or deferred frees (which may free up space for us).
|
* or deferred frees (which may free up space for us).
|
||||||
*/
|
*/
|
||||||
if (used_on_disk + est_inflight >= quota) {
|
ext_quota = quota >> 5;
|
||||||
|
if (quota == UINT64_MAX)
|
||||||
|
ext_quota = 0;
|
||||||
|
|
||||||
|
if (used_on_disk >= quota) {
|
||||||
|
/* Quota exceeded */
|
||||||
|
mutex_exit(&dd->dd_lock);
|
||||||
|
DMU_TX_STAT_BUMP(dmu_tx_quota);
|
||||||
|
return (retval);
|
||||||
|
} else if (used_on_disk + est_inflight >= quota + ext_quota) {
|
||||||
if (est_inflight > 0 || used_on_disk < quota) {
|
if (est_inflight > 0 || used_on_disk < quota) {
|
||||||
retval = SET_ERROR(ERESTART);
|
retval = SET_ERROR(ERESTART);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user