Something like:
- first mail is being expunged
- other mails are being rewritten and they get their space from the
expunged mail
- there's not enough space for the last mail to get space
- we add more space
- we'll now need to use up the space. We can't just decide to mark the
mails dirty.
}
} else if (mail_ctx->need_rewrite) {
mbox_sync_update_header(mail_ctx);
- if (sync_ctx->delay_writes) {
- /* mark it dirty and do it later */
+ if (sync_ctx->delay_writes && sync_ctx->need_space_seq == 0) {
+ /* mark it dirty and do it later. we can't do this
+ if we're in the middle of rewriting acquiring more
+ space. */
mail_ctx->dirty = TRUE;
return 0;
}