public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Grzegorz Kulewski <kangur@polcom.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: How to flush data to disk reliably?
Date: Mon, 02 May 2005 18:52:38 +0100	[thread overview]
Message-ID: <1115056355.10370.37.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.62.0505021503470.11701@alpha.polcom.net>

> I am asking how to flush the data from these logs to disk. I know of 
> several methods:
> 1. open with O_SYNC,
> 2. sync(2),
> 3. fsync,
> 4. fdatasync,
> 5. msync (if they are mmaped).
> 
> Which of these are best and most reliable for (a/b) and for (IDE/SCSI)? 

For scsi the combination of O_SYNC and ext3 or fsync and ext3 should be
reliable. fdatasync doesn't write back all the metadata so depending on
the use may not be sufficient. FAT based fs's I believe you need a
current kernel for full O_SYNC behaviour.

> What are differences between them? 

See the manual pages and/or standard.
 
> other precautions that I should be aware of? What about write caches? Are 
> write barriers implemented (on IDE and SATA/SCSI) or should I turn caches 
> off?

SCSI shoule be fine, IDE turn off the write cache.



  reply	other threads:[~2005-05-02 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-02 13:23 How to flush data to disk reliably? Grzegorz Kulewski
2005-05-02 17:52 ` Alan Cox [this message]
2005-05-02 19:18   ` Grzegorz Kulewski
2005-05-02 21:41     ` Alan Cox
2005-05-02 22:30       ` Bill Davidsen
2005-05-02 23:17         ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1115056355.10370.37.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=kangur@polcom.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox