# HG changeset patch # User Timo Sirainen # Date 1195080403 -7200 # Node ID c1bd43be8f9a44d79c545594717271bf56850bd8 # Parent e70686f19f678a0a454a5069cc75579809e02c86 Don't flush attribute cache the first time when stating a lock file. Usually the locking works fine without it. diff -r e70686f19f67 -r c1bd43be8f9a src/lib/file-dotlock.c --- a/src/lib/file-dotlock.c Thu Nov 15 00:38:05 2007 +0200 +++ b/src/lib/file-dotlock.c Thu Nov 15 00:46:43 2007 +0200 @@ -66,6 +66,7 @@ unsigned int have_pid:1; unsigned int pid_read:1; unsigned int use_io_notify:1; + unsigned int lock_stated:1; }; static struct dotlock * @@ -155,8 +156,12 @@ { struct stat st; - if (lock_info->set->nfs_flush) + /* don't waste time flushing attribute cache the first time we're here. + if it's stale we'll get back here soon. */ + if (lock_info->set->nfs_flush && lock_info->lock_stated) nfs_flush_attr_cache(lock_info->lock_path, TRUE); + + lock_info->lock_stated = TRUE; if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) { if (errno != ENOENT) { i_error("lstat(%s) failed: %m", lock_info->lock_path); @@ -448,7 +453,7 @@ lock_info.lock_path = lock_path; lock_info.fd = -1; lock_info.use_io_notify = set->use_io_notify; -; + last_notify = 0; do_wait = FALSE; do {