dovecot-2.1: quota: Try to avoid logging NFS stale fhandle error...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 10 23:28:25 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/0cd33404a201
changeset: 13926:0cd33404a201
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 10 23:14:18 2012 +0200
description:
quota: Try to avoid logging NFS stale fhandle errors when closing maildirsize file.

diffstat:

 src/plugins/quota/quota-maildir.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 81fa0597b8b6 -r 0cd33404a201 src/plugins/quota/quota-maildir.c
--- a/src/plugins/quota/quota-maildir.c	Tue Jan 10 23:10:04 2012 +0200
+++ b/src/plugins/quota/quota-maildir.c	Tue Jan 10 23:14:18 2012 +0200
@@ -296,13 +296,10 @@
 		return -1;
 	}
 
-	/* keep the fd open since we might want to update it later */
-	if (file_dotlock_replace(&dotlock,
-				 DOTLOCK_REPLACE_FLAG_DONT_CLOSE_FD) < 0) {
+	if (file_dotlock_replace(&dotlock, 0) < 0) {
 		i_error("file_dotlock_replace(%s) failed: %m", path);
 		return -1;
 	}
-	root->fd = fd;
 	return 0;
 }
 
@@ -872,8 +869,11 @@
 		(void)close(root->fd);
 		root->fd = -1;
 		(void)maildirsize_recalculate(root);
-	} else if (maildirsize_update(root, ctx->count_used, ctx->bytes_used) < 0)
+	} else if (maildirsize_update(root, ctx->count_used, ctx->bytes_used) < 0) {
+		(void)close(root->fd);
+		root->fd = -1;
 		maildirsize_rebuild_later(root);
+	}
 
 	return 0;
 }


More information about the dovecot-cvs mailing list