[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-copy.c, 1.49, 1.50
tss at dovecot.org
tss at dovecot.org
Mon Jan 22 16:21:37 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv7224
Modified Files:
maildir-copy.c
Log Message:
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/.
Index: maildir-copy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-copy.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- maildir-copy.c 22 Dec 2006 14:20:38 -0000 1.49
+++ maildir-copy.c 22 Jan 2007 16:21:34 -0000 1.50
@@ -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);
More information about the dovecot-cvs
mailing list