Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5056:20bcdc161e71 HEAD
maildir_copy_with_hardlinks=yes could have caused "Duplicate file in
uidlist" errors. The fix slows it down a bit though, the files are now
always first hardlinked to tmp/ and later rename()d from there to cur/ or
new/.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 22 Jan 2007 18:21:34 +0200 |
parents | 359bfdd06b27 |
children | d86ee13688d5 |
files | src/lib-storage/index/maildir/maildir-copy.c |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-copy.c Mon Jan 22 17:21:15 2007 +0200 +++ b/src/lib-storage/index/maildir/maildir-copy.c Mon Jan 22 18:21:34 2007 +0200 @@ -145,6 +145,11 @@ do_ctx.preserve_filename = TRUE; } + /* FIXME: We could hardlink the files directly to destination, but + that would require checking if someone else had already assigned + UIDs for them after we have the uidlist locked. Index would also + need to be properly not-updated somehow.. */ +#if 0 if (keywords == NULL || keywords->count == 0) { /* no keywords, hardlink directly to destination */ if (flags == MAIL_RECENT) { @@ -161,7 +166,9 @@ do_ctx.dest_fname, flags, NULL)); } - } else { + } else +#endif +{ /* keywords, hardlink to tmp/ with basename and later when we have uidlist locked, move it to new/cur. */ str_printfa(do_ctx.dest_path, "%s/tmp/%s", @@ -176,12 +183,15 @@ return 0; } +#if 0 if (keywords == NULL || keywords->count == 0) { /* hardlinked to destination, set hardlinked-flag */ seq = maildir_save_add(t, do_ctx.dest_fname, flags | MAILDIR_SAVE_FLAG_HARDLINK, NULL, dest_mail); - } else { + } else +#endif +{ /* hardlinked to tmp/, treat as normal copied mail */ seq = maildir_save_add(t, do_ctx.dest_fname, flags, keywords, dest_mail);