On Fri, 2009-10-16 at 22:41 +0400, Kostik wrote: > close(/var/virtual/mail/I/I/koc.lock) failed: Disk quota exceeded
Oh, I didn't read carefully enough. Closing .lock failed, not mbox. Does the attached patch help?
diff -r ebb2a91e6df7 src/lib/file-dotlock.c --- a/src/lib/file-dotlock.c Fri Oct 16 13:16:07 2009 -0400 +++ b/src/lib/file-dotlock.c Fri Oct 16 14:41:18 2009 -0400 @@ -299,13 +299,14 @@ return 0; } -static int file_write_pid(int fd, const char *path) +static int file_write_pid(int fd, const char *path, bool nfs_flush) { const char *str; /* write our pid and host, if possible */ str = t_strdup_printf("%s:%s", my_pid, my_hostname); - if (write_full(fd, str, strlen(str)) < 0) { + if (write_full(fd, str, strlen(str)) < 0 || + (nfs_flush && fdatasync(fd) < 0)) { /* failed, leave it empty then */ if (ftruncate(fd, 0) < 0) { i_error("ftruncate(%s) failed: %m", path); @@ -357,7 +358,8 @@ if (write_pid) { if (file_write_pid(lock_info->fd, - str_c(tmp_path)) < 0) { + str_c(tmp_path), + lock_info->set->nfs_flush) < 0) { (void)close(lock_info->fd); lock_info->fd = -1; return -1; @@ -402,7 +404,8 @@ } if (write_pid) { - if (file_write_pid(fd, lock_info->lock_path) < 0) { + if (file_write_pid(fd, lock_info->lock_path, + lock_info->set->nfs_flush) < 0) { (void)close(fd); return -1; }
signature.asc
Description: This is a digitally signed message part