[Dovecot] Non-blocking file_dotlock_open() in quota-maildir question
do1 at yandex.ru
do1 at yandex.ru
Mon Jul 8 21:42:08 EEST 2013
Hello,
Is it safe to change lines in plugins/quota/quota-maildir.c::maildirsize_write() from
fd = file_dotlock_open_group(.., DOTLOCK_CREATE_FLAG_NONBLOCK, ..);
to
fd = file_dotlock_open_group(.., 0, ..); ?
Rationale is: exim+cpanel frequently leave stale maldirsize.lock, but when quota plugin try to dotlock maildirsize, it do this with NONBLOCK flag and just once, so first lock fails with EAGAIN and second may never happen. (When last mail is over quota this also prevent user from further receiving any mail because quota remain exceeded, forver. This is annoing problem.) I wonder if it is possible to do easy fix problem by removing NONBLOCK flag, but as I don't understand why this NONBLOCK flag is used in the first place I decided to ask developers in the list for approval.
If removing NONBLOCK flag is not possible I will just call file_dotlock_open_group() twice if first one return -1 with EAGAIN.
Best regards,
Don.
More information about the dovecot
mailing list