On Thu, Aug 23, 2012 at 01:24:40PM +0200, Joerg Dorchain wrote:
> However, it then forks the mutt_dotlock process, which fails
> because it the filesystem with the mbox is readonly. 
> 
> The source from mbox.c reads
> if (mbox_lock_mailbox (ctx, 0, 0) == -1)
>         {
>           mutt_unblock_signals ();
>           /* we couldn't lock the mailbox, but nothing serious happened:
>            * probably the new mail arrived: no reason to wait till we can
>            * parse it: we'll get it on the next pass
>            */
>           return (M_LOCKED);
>         }
> 
> Needless to say the assumption expressed in the comments does not
> hold.
> 
> Would this finding justify a bug report?

Not really.  You can't really fix this.  If mutt can't lock the folder
then other processes (e.g. the MDA) can change the contents out from
under Mutt while it's reading the file, potentially resulting in an
inconsistent state.

But, there's probably not really any good reason to read mail from a
read-only NFS mount, so just stop doing that, and your problem should
go away.  If the mail is local, read it locally; if you must use NFS,
then there are some other considerations.  You may want to swtich to
maildir to avoid locking problems entirely.  Or if not, and you're on
Linux, you should know that:

 - Dot-locking is (or at least was, and may still be) unreliable over NFS
 - POSIX locking (i.e. fctnl()) is not.

So Mutt's default locking options should work for you, since it uses
both dot-locking (unreliable) and fcntl() (reliable).  Also note that
on other Unix systems, the opposite has historically been typically
true, so you'll get plenty of people telling you not to trust that.
But the Linux open() man page documents the reason why the dot locking
doesn't work, and tells you to use fcntl() instead.  There WERE some
serious bugs in Linux's lockd that made all forms of locking over NFS
not reliable on Linux, but those were fixed c. 2001 or so.


-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgp29MsZGsYzW.pgp
Description: PGP signature

Reply via email to