[Dovecot] Solaris NFS woes

Mario Nigrovic Mario.Nigrovic at freescale.com
Sat Dec 16 02:43:58 UTC 2006


Timo -

For some reason, this patch didn't want to apply, for me, but I put the code in manually and it seems to have fixed all the obvious problems.  Thanks!

					Mario

Timo Sirainen wrote:
> On Fri, 2006-12-15 at 13:08 -0500, John Harper wrote:
>> I am using dovecot 1.0.rc15 (a similar problem occurred in rc10) on
>> Solaris 9 (sparc). When working with a user who's home dir is on a
>> local disk everything seems fine. But when that home is on an
>> NFS-mounted disk things are very badly awry.
>>
>> Both the indices and the subscriptions file are being destroyed and
>> what is left behind are files with names of the form .nfs72C034 etc.
> 
> I've heard of this before. I think there's a Solaris kernel patch to fix
> this, but I'm not sure. If you find it, please add a note about it to
> http://wiki.dovecot.org/NFS
> 
> Anyway if I remember correctly, the problem went like this:
> 
> 1. Dovecot creates a temp.1234 file, link()s it into subscriptions.lock
> file and unlink()s temp.1234.
> 2. The subscriptions are written to the lock file, and then Dovecot does
> rename(subscriptions.lock, subscriptions)
> 3. The file is close()d
> 
> By closing the file before renaming, the problem went away. I think most
> of these problems could be fixed with a simple patch, but I didn't want
> to do that change because it probably still breaks with other less
> obvious things, so it's better to be fully broken.
> 
> You could anyway try if this mostly-fixes it:
> 
> Index: src/lib/file-dotlock.c
> ===================================================================
> RCS file: /var/lib/cvs/dovecot/src/lib/file-dotlock.c,v
> retrieving revision 1.35.2.3
> diff -u -r1.35.2.3 file-dotlock.c
> --- src/lib/file-dotlock.c      8 Jun 2006 16:13:46 -0000       1.35.2.3
> +++ src/lib/file-dotlock.c      16 Dec 2006 01:30:06 -0000
> @@ -664,6 +664,12 @@
>                 }
>         }
>  
> +       if (dotlock->fd != -1) {
> +               if (close(dotlock->fd) < 0)
> +                       i_error("close(%s) failed: %m", dotlock->path);
> +               dotlock->fd = -1;
> +       }
> +
>         if (rename(lock_path, dotlock->path) < 0) {
>                 i_error("rename(%s, %s) failed: %m", lock_path, dotlock->path);
>                 file_dotlock_free(dotlock);
> 


-- 
I don't need a name; my number's just fine. |   Mario.Nigrovic at freescale.com
It's nobody else's -- just mine, all mine.  |                   480-413-3578
                                                           Internal Use Only


More information about the dovecot mailing list