Unofficial Hacker News companion — get notified on comment replies, and more.

"This message has been on the screen for almost two hours now." (opens external site)

337 points by firloop 2 days ago | unsung.aresluna.org | 225 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (8)

  1. Journaling saves you from catastrophic filesystem corruption, but it doesn't make sure data that's still in caches has been fully saved to disk. Applications may not have saved their work, and even if they have, the OS may not have written everything out yet.
    Replies (1)
    1. Any application that depends on cached state must be able to start up in a sane way if that state is corrupted. If it can't, it's not worth using.
      Replies (2)
      1. You edit a file in a text editor. You save the file. You close the text editor. You cut power.

        The file is lost because it was not written to the disk.

        How is this a sign that the text editor is not worth using?

        Replies (2)
        1. That's got nothing to do with cached data or corruption.
          Replies (1)
          1. File not being stored to disk after the application saves it has everything to do with cached data. It's exactly what this thread is about.
            Replies (1)
            1. Application should call sync() or equivalent and get a positive result before reporting to the user that the file was saved. If the OS hasn't actually written the bits to disk yet, or the disk controller has cached them but not written them, not much the application can do.

              But all of that is beside the point. What I said was that the application should do something sane if the cached data is missing or corrupt. Not that it should never lose data; that's impossible for any app to guarantee.

        2. They did say cached data
      2. Consistency isn’t everything. Sometimes people also just don’t want to lose their changes, i.e. durability.