public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: Anton Altaparmakov <aia21@cam.ac.uk>,
	aia21@hermes.cam.ac.uk,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org, mike.miller@hp.com
Subject: Re: [Question] Does the kernel ignore errors writng to disk?
Date: Fri, 29 Apr 2005 23:00:37 +0100	[thread overview]
Message-ID: <1114812035.18330.396.camel@localhost.localdomain> (raw)
In-Reply-To: <OF48BA3721.BD4798AD-ON88256FF2.00680E7E-88256FF2.0069814F@us.ibm.com>

On Gwe, 2005-04-29 at 20:11, Bryan Henderson wrote:
> So I view it as correct even if fsync() does nothing on a disk-based 
> filesystem because the programmer was lazy (or because the user wants to 
> defeat the performance-busting behavior of some paranoid application). But 
> when Alan speaks of a "not completely correct" version of synchronization, 
> which makes me think of something that doesn't implement any consistent 
> form of "stable," I want to hear more.

On the main fs's people use with a current kernel fsync guarantees the
data went somewhere. What it guarantees beyond that depends on the fs
properties, the driver properties and the media properties.

So ext3 journal=data or jffs which are the strongest guarantee cases
mean that your fsync() data should be on media and stable. Ditto I
believe default ext3 behaviour because fsync has stronger rules than
fdatasync.

The next question is what the I/O device does with the data. SCSI disks
will cache but the scsi layer uses tags and if neccessary turns the
cache off on the drive. In other words you should get that behaviour
correctly on SCSI media.

The default IDE behaviour doesn't turn write cache off and the IDE
device may re-order writes and ack them before they hit storage. IDE
lacks tags, and tends to have poor performance on cache flush commands.
With the barrier support on the right thing should occur, or with hdparm
used to turn the write cache off.

Raid controllers will cache data in their writeback caches, they will
also write and rewrite stripes which can mean a critical failure loses
the cache or involves a whole stripe loss, but that is very unlikely in
most modes. The good ones either write through or have battery backed
caches. The really good ones even let you put the battery/ram unit onto
another card.

Underlying all of this is the fact that disks aren't really disks any
more but NAS devices on funky cables, that can mean you can lose blocks
to drive faults that might not be the block you are currently writing.

Alan


  reply	other threads:[~2005-04-29 22:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 18:40 [Question] Does the kernel ignore errors writng to disk? mike.miller
2005-04-27 19:12 ` Richard B. Johnson
2005-04-28 14:58 ` Alan Cox
2005-04-28 18:14   ` Bryan Henderson
2005-04-28 22:43     ` Alan Cox
2005-04-28 23:14       ` Bryan Henderson
2005-04-29  7:25         ` Anton Altaparmakov
2005-04-29 19:11           ` Bryan Henderson
2005-04-29 22:00             ` Alan Cox [this message]
2005-04-30  0:41               ` Bryan Henderson
2005-05-01  9:01               ` Mogens Valentin
2005-04-28 23:22   ` Bartlomiej Zolnierkiewicz
2005-04-28 23:50     ` Alan Cox
2005-04-29  0:33       ` Bartlomiej Zolnierkiewicz
  -- strict thread matches above, loose matches on Subject: below --
2005-04-28 15:05 Miller, Mike (OS Dev)

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=1114812035.18330.396.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=aia21@cam.ac.uk \
    --cc=aia21@hermes.cam.ac.uk \
    --cc=hbryan@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    /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