EC: handle statfs with simple-quota
this should be similar to deem-statfs-quota
Change-Id: I8b8bc7189a9a59d1fab9dbc2013310988a2baf80 Signed-off-by: Amar Tumballi [email protected]
This is good to handle issues like github.com/kadalu/kadalu#823. simple-quota with disperse need few more fixes like what should be the actual value of quota limit we should use at bricks.
Ideal fix is handling the quota set flag itself with value divided by fragments. Will send that fix with more testing and test cases. But for now, making it similar to deem-statfs would be good enough.
@xhernandez when you check this PR, see if the below is a better option instead of changing _cbk()
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index 9b5fe2a7fd..74576e725c 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -755,6 +755,19 @@ ec_setxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
}
}
+ ec_t *ec = fop->xl->private;
+ int64_t val = 0;
+ ret = dict_get_int64(fop->dict, SQUOTA_LIMIT_KEY, &val);
+ if (IS_SUCCESS(ret)) {
+ /* divide the total usage to priv->fragments */
+ int64_t new_value = val / ec->fragments;
+ ret = dict_set_int64(fop->dict, SQUOTA_LIMIT_KEY, new_value);
+ if (IS_ERROR(ret)) {
+ /* Add a trace log */
+ gf_msg(ec->xl->name, GF_LOG_DEBUG, ENOMEM, 0,
+ "Failed to update the simple-quota limit");
+ }
+ }
error = 0;
out:
@amarts, this PR is not needed anymore now that #3672 is merged, right ?
Yes. Let me close
Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.
Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.