changeset 5971:2bc25f61431f HEAD

Flush NFS attribute cache before stat()ing files.
author Timo Sirainen <tss@iki.fi>
date Thu, 12 Jul 2007 23:54:34 +0300
parents a290b84d144a
children 9fb9dc4d8df8
files src/lib/file-dotlock.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/file-dotlock.c	Thu Jul 12 23:54:13 2007 +0300
+++ b/src/lib/file-dotlock.c	Thu Jul 12 23:54:34 2007 +0300
@@ -149,6 +149,7 @@
 {
 	struct stat st;
 
+	nfs_flush_attr_cache(lock_info->lock_path);
 	if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) {
 		if (errno != ENOENT) {
 			i_error("lstat(%s) failed: %m", lock_info->lock_path);
@@ -232,6 +233,7 @@
 
 		/* possibly stale lock file. check also the timestamp of the
 		   file we're protecting. */
+		nfs_flush_attr_cache(lock_info->path);
 		if (nfs_safe_stat(lock_info->path, &st) < 0) {
 			if (errno == ENOENT) {
 				/* file doesn't exist. treat it as if