dovecot: Handle multiple simultaneous DELETEs better.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 18 06:49:26 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/bba5f170a565
changeset: 6066:bba5f170a565
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 18 06:49:22 2007 +0300
description:
Handle multiple simultaneous DELETEs better.

diffstat:

1 file changed, 3 insertions(+), 2 deletions(-)
src/lib-storage/index/maildir/maildir-storage.c |    5 +++--

diffs (22 lines):

diff -r 16698620809a -r bba5f170a565 src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Wed Jul 18 06:42:17 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Wed Jul 18 06:49:22 2007 +0300
@@ -774,7 +774,7 @@ maildir_list_delete_mailbox(struct mailb
 	   ..DOVECOT-TRASH directory, it gets deleted the next time
 	   mailbox listing sees it. */
 	count = 0;
-	while (rename(src, dest) < 0 && count < 2) {
+	while (rename(src, dest) < 0) {
 		if (errno == ENOENT) {
 			/* it was just deleted under us by
 			   another process */
@@ -789,7 +789,8 @@ maildir_list_delete_mailbox(struct mailb
 		}
 
 		/* already existed, delete it and try again */
-		if (unlink_directory(dest, TRUE) < 0) {
+		if (unlink_directory(dest, TRUE) < 0 &&
+		    (errno != ENOTEMPTY || count >= 5)) {
 			mailbox_list_set_critical(list,
 				"unlink_directory(%s) failed: %m", dest);
 			return -1;


More information about the dovecot-cvs mailing list