[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-copy.c, 1.43.2.3, 1.43.2.4
tss at dovecot.org
tss at dovecot.org
Mon Jan 22 16:21:34 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv7228
Modified Files:
Tag: branch_1_0
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.43.2.3
retrieving revision 1.43.2.4
diff -u -d -r1.43.2.3 -r1.43.2.4
--- maildir-copy.c 22 Dec 2006 14:20:31 -0000 1.43.2.3
+++ maildir-copy.c 22 Jan 2007 16:21:31 -0000 1.43.2.4
@@ -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 != NULL);
- } else {
+ } else
+#endif
+{
/* hardlinked to tmp/, treat as normal copied mail */
seq = maildir_save_add(t, do_ctx.dest_fname, flags, keywords,
dest_mail != NULL);
More information about the dovecot-cvs
mailing list