lkml.org 
[lkml]   [2009]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Linux 2.6.29


    On Fri, 27 Mar 2009, Linus Torvalds wrote:
    >
    > Yes, some editors (vi, emacs) do it, but even there it's configurable.

    .. and looking at history, it's even pretty modern. From the vim logs:

    Patch 6.2.499
    Problem: When writing a file and halting the system, the file might be lost
    when using a journalling file system.
    Solution: Use fsync() to flush the file data to disk after writing a file.
    (Radim Kolar)
    Files: src/fileio.c

    so it looks (assuming those patch numbers mean what they would seem to
    mean) that 'fsync()' in vim is from after 6.2 was released. Some time in
    2004.

    So traditionally, even solid "good" programs like major editors never
    tried to fsync() their files.

    Btw, googling for that 6.2.499 patch also shows that people were rather
    unhappy with it. Why? It causes disk spinups in laptop mode etc. Which is
    very much not what you want to see for power reasons.

    So there are other, really fundamental, reasons why applications that
    don't have the "mailspool must not be lost" kind of critical issues to
    absolutely NOT use fsync(). Those applications would be much better off
    with some softer hint that can take things like laptop mode into account.

    Linus


    \
     
     \ /
      Last update: 2009-03-27 19:29    [W:4.047 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site