dovecot-2.2: lib-fs: fs_write() didn't update stats.write_count ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Aug 16 11:14:55 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/295fd771e02d
changeset: 18934:295fd771e02d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Aug 16 13:07:21 2015 +0200
description:
lib-fs: fs_write() didn't update stats.write_count correctly.
If backend implemented asynchronous write(), the write_count was updated multiple
times. If backend didn't implement write(), then it was counted twice.

diffstat:

 src/lib-fs/fs-api.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 1ed8418031b6 -r 295fd771e02d src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Sat Aug 15 12:14:35 2015 +0200
+++ b/src/lib-fs/fs-api.c	Sun Aug 16 13:07:21 2015 +0200
@@ -530,11 +530,12 @@
 {
 	int ret;
 
-	file->fs->stats.write_count++;
 	if (file->fs->v.write != NULL) {
 		T_BEGIN {
 			ret = file->fs->v.write(file, data, size);
 		} T_END;
+		if (!(ret < 0 && errno == EAGAIN))
+			file->fs->stats.write_count++;
 		return ret;
 	}
 


More information about the dovecot-cvs mailing list