2.3.9 mod time bug

John Capo jc at irbs.com
Sat Sep 1 09:34:32 EDT 2007


Quoting David Carter (dpc22 at cam.ac.uk):
> On Fri, 31 Aug 2007, John Capo wrote:
> 
> >Another thing, the fsync()/fclose() calls in this loop in
> >sync_message_fsync() should be reversed, at least on on BSD systems.
> >
> >   /* fsync() files in reverse order: ReiserFS FAQ indicates that this
> >    * gives best potential for optimisation */
> >   for (i = (l->file_count-1) ; i >= 0 ; i--) {
> >       fsync(fileno(l->file[i]));
> >       fclose(l->file[i]);
> >       l->file[i] = NULL;
> >   }
> 
> My current tree has:
> 
>     /* fsync() files in reverse order: ReiserFS FAQ indicates that this
>      * gives best potential for optimisation */
>     for (i = (l->file_count-1) ; i >= 0 ; i--) {
>         if ((fflush(l->file[i]) != 0) ||
>             (fsync(fileno(l->file[i])) < 0) ||
>             (fclose(l->file[i]) != 0))
>             r = IMAP_IOERROR;  /* Aggregate to single error */
> 
>         l->file[i] = NULL;
>     }
>     l->file_count = 0;
> 
> Looks like it been that way since July 2005. Hope this wasn't a bug
> fix that I failed to merge upstream.

My 2.3.9 source from CVS on the 28th are missing the fflush() call.
My cvs fetch must be broken.


> 
> -- 
> David Carter                             Email: David.Carter at ucs.cam.ac.uk
> University Computing Service,            Phone: (01223) 334502
> New Museums Site, Pembroke Street,       Fax:   (01223) 334679
> Cambridge UK. CB2 3QH.


More information about the Cyrus-devel mailing list