From: Greg Freemyer <greg.freemyer@gmail.com>
To: Ric Wheeler <rwheeler@redhat.com>
Cc: Anton Altaparmakov <aia21@cam.ac.uk>,
Nick Piggin <npiggin@suse.de>, Dave Chinner <david@fromorbit.com>,
Jan Kara <jack@suse.cz>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Andreas Dilger <adilger@sun.com>, "Theodore Ts'o" <tytso@mit.edu>,
Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: IO error semantics
Date: Mon, 25 Jan 2010 11:15:50 -0500 [thread overview]
Message-ID: <87f94c371001250815t92cbce9t95df5c274745dae9@mail.gmail.com> (raw)
In-Reply-To: <4B5DB78D.2090408@redhat.com>
On Mon, Jan 25, 2010 at 10:23 AM, Ric Wheeler <rwheeler@redhat.com> wrote:
> On 01/18/2010 06:33 PM, Anton Altaparmakov wrote:
>>
>> Hi,
>>
>> On 18 Jan 2010, at 14:00, Nick Piggin wrote:
>>
>>>
>>> For write errors, you could also do block re-allocation, which would be
>>> fun.
>>>
>>
>> Yes it would. (-:
>>
>> FWIW, Windows does this with Microsoft's NTFS driver. When a write fails
>> due to a bad block, the block is marked as bad (recorded in the bad cluster
>> list and marked as allocated in the in-use bitmap so no-one tries to
>> allocate it), a new block is allocated, inode metadata is updated to reflect
>> the change in the logical to physical block map of the file the block
>> belongs to, and the write is then re-tried to its new location.
>>
>> I have never bothered implementing it in NTFS on Linux partially because
>> there doesn't seem any obvious way to do it inside the file system. I think
>> the VFS and/or the block layer would have to offer help there in some way.
>> What I mean for example is that if ->writepage fails then the failure is
>> only detected inside the asynchronous i/o completion handler at which point
>> the page is not locked any more, it is marked as being under writeback, and
>> we are in IRQ context (or something) and thus it is not easy to see how we
>> can from there get to doing all the above needed actions that require memory
>> allocations, disk i/o, etc... I suppose a separate thread could do it where
>> we just schedule the work to be done. But problem with that is that that
>> work later on might fail so we can't simply pretend the block was written
>> successfully yet we do not want to report an error or the upper layers would
>> pick it up even though we hopefully will correct it in due course...
>>
>> Best regards,
>>
>> Anton
>>
>
> For permanent write errors, I would expect any modern drive to do a sector
> remapping internally. We should never need to track this kind of information
> for any modern device that I know of (S-ATA, SAS, SSD's and raid arrays
> should all handle this).
>
> Would not seem to be worth the complexity.
>
> Also keep in mind that retrying IO errors is not always a good thing
next prev parent reply other threads:[~2010-01-25 16:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 6:12 [PATCH] ext3: prevent reread after write IO error Hidehiro Kawai
2010-01-14 9:05 ` Hidehiro Kawai
2010-01-14 10:14 ` [PATCH] ext3: prevent reread after write IO error v2 Hidehiro Kawai
2010-01-14 14:18 ` Jan Kara
2010-01-15 10:38 ` Hidehiro Kawai
2010-01-18 5:18 ` Nick Piggin
2010-01-18 6:05 ` IO error semantics Nick Piggin
2010-01-18 12:24 ` Dave Chinner
2010-01-18 14:00 ` Nick Piggin
2010-01-18 22:51 ` Dave Chinner
2010-01-18 23:33 ` Anton Altaparmakov
2010-01-25 15:23 ` Ric Wheeler
2010-01-25 16:15 ` Greg Freemyer [this message]
2010-01-25 17:47 ` tytso
2010-01-25 17:50 ` Ric Wheeler
2010-01-25 17:59 ` Nick Piggin
[not found] ` <20100125175529.GB2018@laptop>
2010-01-26 6:19 ` Dave Chinner
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=87f94c371001250815t92cbce9t95df5c274745dae9@mail.gmail.com \
--to=greg.freemyer@gmail.com \
--cc=adilger@sun.com \
--cc=aia21@cam.ac.uk \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=rwheeler@redhat.com \
--cc=satoshi.oshima.fk@hitachi.com \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).