Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] ext4fs reliability bug

2009-03-20 by manu@netbsd.org

Greg Troxel <gdt@...> wrote:

> fflush()
> fsync()
> fclose()

So we would do that?

Index: dump.c
===================================================================
RCS file: /milter-greylist/milter-greylist/dump.c,v
retrieving revision 1.35
diff -U2 -r1.35 dump.c
--- dump.c      29 Dec 2007 19:06:49 -0000      1.35
+++ dump.c      20 Mar 2009 20:30:02 -0000
@@ -288,5 +288,13 @@
            "whitelisted\n#\n", done, greylisted_count,
whitelisted_count);
 
-       Fclose(dump);
+       /*
+        * Ensure that the data is really flushed to disk.
+        * Some systems might delay the data write from kernel buffer
+        * to disk even after the file is closed
+        */
+       (void)fflush(dump);
+       (void)fsync(fileno(dump));
+       (void)Fclose(dump);
+
        if (s_buffer)
                free(s_buffer);


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.