changeset 17741:58eaff87a81b

fts-lucene: When deleting corrupted lucene-indexes/ directory, don't rmdir it. This at least avoids errors with NFS when some of the files are still open inside it by other processes.
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Aug 2014 14:49:34 +0200
parents 9cdf42df4c4b
children b0c301f2d616
files src/plugins/fts-lucene/lucene-wrapper.cc
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts-lucene/lucene-wrapper.cc	Thu Aug 21 14:48:41 2014 +0200
+++ b/src/plugins/fts-lucene/lucene-wrapper.cc	Thu Aug 21 14:49:34 2014 +0200
@@ -268,8 +268,7 @@
 	     err.number() == CL_ERR_IO)) {
 		/* delete corrupted index. most IO errors are also about
 		   missing files and other such corruption.. */
-		if (unlink_directory(index->path,
-				     UNLINK_DIRECTORY_FLAG_RMDIR) < 0 &&
+		if (unlink_directory(index->path, 0) < 0 &&
 		    errno != ENOENT)
 			i_error("unlink_directory(%s) failed: %m", index->path);
 		rescan_clear_unseen_mailboxes(index, NULL);
@@ -415,7 +414,7 @@
 		return ret;
 
 	/* settings changed, rebuild index */
-	if (unlink_directory(index->path, UNLINK_DIRECTORY_FLAG_RMDIR) < 0) {
+	if (unlink_directory(index->path, 0) < 0) {
 		i_error("unlink_directory(%s) failed: %m", index->path);
 		ret = -1;
 	} else {