dovecot-2.1: mdbox: Make sure map transaction won't succeed afte...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jun 4 14:04:30 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/99d31c803b7b
changeset: 14546:99d31c803b7b
user: Timo Sirainen <tss at iki.fi>
date: Mon Jun 04 13:59:40 2012 +0300
description:
mdbox: Make sure map transaction won't succeed after mdbox_map_atomic_set_failed()
diffstat:
src/lib-storage/index/dbox-multi/mdbox-map-private.h | 1 +
src/lib-storage/index/dbox-multi/mdbox-map.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r 36d2aff85a69 -r 99d31c803b7b src/lib-storage/index/dbox-multi/mdbox-map-private.h
--- a/src/lib-storage/index/dbox-multi/mdbox-map-private.h Tue May 29 22:22:14 2012 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-map-private.h Mon Jun 04 13:59:40 2012 +0300
@@ -57,6 +57,7 @@
unsigned int map_refreshed:1;
unsigned int locked:1;
unsigned int success:1;
+ unsigned int failed:1;
};
int mdbox_map_view_lookup_rec(struct mdbox_map *map,
diff -r 36d2aff85a69 -r 99d31c803b7b src/lib-storage/index/dbox-multi/mdbox-map.c
--- a/src/lib-storage/index/dbox-multi/mdbox-map.c Tue May 29 22:22:14 2012 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-map.c Mon Jun 04 13:59:40 2012 +0300
@@ -519,11 +519,13 @@
void mdbox_map_atomic_set_failed(struct mdbox_map_atomic_context *atomic)
{
atomic->success = FALSE;
+ atomic->failed = TRUE;
}
void mdbox_map_atomic_set_success(struct mdbox_map_atomic_context *atomic)
{
- atomic->success = TRUE;
+ if (!atomic->failed)
+ atomic->success = TRUE;
}
int mdbox_map_atomic_finish(struct mdbox_map_atomic_context **_atomic)
@@ -595,7 +597,7 @@
mail_index_reset_error(ctx->atomic->map->index);
return -1;
}
- ctx->atomic->success = TRUE;
+ mdbox_map_atomic_set_success(ctx->atomic);
return 0;
}
@@ -1379,7 +1381,7 @@
if (dbox_file_append_commit(&file_appends[i]) < 0)
return -1;
}
- ctx->atomic->success = TRUE;
+ mdbox_map_atomic_set_success(ctx->atomic);
return 0;
}
More information about the dovecot-cvs
mailing list