From: Douglas Gilbert <dgilbert@interlog.com>
To: Jeremy Linton <jlinton@tributary.com>,
joystick <joystick@shiftmail.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: Write cache and surface error behaviour
Date: Mon, 28 Jul 2014 18:43:13 -0700 [thread overview]
Message-ID: <53D6FC31.3040908@interlog.com> (raw)
In-Reply-To: <53D6E35C.5020107@tributary.com>
On 14-07-28 04:57 PM, Jeremy Linton wrote:
> On 7/20/2014 4:54 PM, joystick wrote:
>> So what happens when the disk tries to write it to the platter and
>> discovers that there is a media error on that sector? (suppose relocation
>> does not happen ; maybe sectors exhausted) Does Linux receive the write
>> error upon the next flush it issues?
>
> At least for SCSI I believe the situation you describe is covered in the SCSI
> specifications as a deferred error. Basically, the device returns a check
> condition indicating a deferred failure in response to another command.
>
> My understanding (and I'm sure others can correct it) is that the device
> server can issue these check conditions anytime it wants. The only guarantee is
> that data written before the last successful SYNC is on the media (doesn't mean
> you can read it!). So, in order to guarantee data is not lost, a system using
> writeback should retain all of the writeback data until a successful SYNC CACHE
> operation.
>
> For example see, SPC4 4.5.7 note 6.
>
> If you consider what happens during power loss to a write-back cache, its the
> same situation. Bottom line, make sure to issue sync's for data you want to
> retain and use a filesystem/device that supports barriers and SYNC CACHE/CACHE
> FLUSH correctly. Still YMMV.
Another possibility is to use the WRITE AND VERIFY commands
which have 10, 16 and 32 byte variants. They always write to
the medium and never (as far as I can see) lead to deferred
errors being generated for some subsequent commands. So if
the write "goes bad" and can't be re-assigned to another
part of the medium (because that is disallowed or resources are
depleted) then the application client will be informed in the
status and sense data for the offending WRITE AND VERIFY.
So a remaining issue is how well the WRITE AND VERIFY command
is supported by modern disks and RAIDs.
Doug Gilbert
prev parent reply other threads:[~2014-07-29 1:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-20 21:54 Write cache and surface error behaviour joystick
2014-07-21 14:55 ` Dale R. Worley
2014-07-28 20:37 ` Dale R. Worley
2014-07-28 23:57 ` Jeremy Linton
2014-07-29 1:43 ` Douglas Gilbert [this message]
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=53D6FC31.3040908@interlog.com \
--to=dgilbert@interlog.com \
--cc=jlinton@tributary.com \
--cc=joystick@shiftmail.org \
--cc=linux-scsi@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