Skip to content

Commit

Permalink
quota: Remove "Failed to set quota transaction limits" error
Browse files Browse the repository at this point in the history
This error adds nothing that helps the user to debug a problem.
  • Loading branch information
mrannanj authored and cmouse committed Feb 1, 2018
1 parent de338ef commit a921274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/plugins/quota/quota-storage.c
Expand Up @@ -291,7 +291,7 @@ quota_copy(struct mail_save_context *ctx, struct mail *mail)
const char *error;
if (quota_transaction_set_limits(qt, &error_res, &error) < 0 &&
error_res != QUOTA_GET_RESULT_BACKGROUND_CALC)
i_error("Failed to set quota transaction limits: %s", error);
i_error("quota: %s", error);

if (qbox->module_ctx.super.copy(ctx, mail) < 0)
return -1;
Expand Down Expand Up @@ -352,7 +352,7 @@ quota_save_begin(struct mail_save_context *ctx, struct istream *input)
enum quota_get_result error_res;
if (quota_transaction_set_limits(qt, &error_res, &error) < 0 &&
error_res != QUOTA_GET_RESULT_BACKGROUND_CALC)
i_error("Failed to set quota transaction limits: %s", error);
i_error("quota: %s", error);

return qbox->module_ctx.super.save_begin(ctx, input);
}
Expand Down
11 changes: 2 additions & 9 deletions src/plugins/quota/quota.c
Expand Up @@ -1308,11 +1308,8 @@ enum quota_alloc_result quota_try_alloc(struct quota_transaction_context *ctx,
const char *error;
enum quota_get_result error_res;

if (quota_transaction_set_limits(ctx, &error_res, &error) < 0) {
*error_r = t_strdup_printf(
"Failed to set quota transaction limits: %s", error);
if (quota_transaction_set_limits(ctx, &error_res, error_r) < 0)
return QUOTA_ALLOC_RESULT_TEMPFAIL;
}

if (ctx->no_quota_updates)
return QUOTA_ALLOC_RESULT_OK;
Expand Down Expand Up @@ -1353,13 +1350,9 @@ enum quota_alloc_result quota_test_alloc(struct quota_transaction_context *ctx,
return QUOTA_ALLOC_RESULT_TEMPFAIL;
}

const char *error;
enum quota_get_result error_res;
if (quota_transaction_set_limits(ctx, &error_res, &error) < 0) {
*error_r = t_strdup_printf(
"Failed to set quota transaction limits: %s", error);
if (quota_transaction_set_limits(ctx, &error_res, error_r) < 0)
return QUOTA_ALLOC_RESULT_TEMPFAIL;
}

uoff_t max_size = ctx->quota->set->max_mail_size;
if (max_size > 0 && size > max_size) {
Expand Down

0 comments on commit a921274

Please sign in to comment.