* Does raid5 have error handling while reading?
@ 2009-05-22 8:10 Xu Yuehai
2009-05-22 8:35 ` NeilBrown
0 siblings, 1 reply; 4+ messages in thread
From: Xu Yuehai @ 2009-05-22 8:10 UTC (permalink / raw)
To: linux-raid; +Cc: Trace Green
I know that if the read request of raid5 is handled by
chunk_aligned_read, there is no error handling in raid5. But, if this
read request is not aligned, that's say, raid5 need stripe_head to
deal with this request. I find in the code of 2.6.27 that there is no
error handling if this read request fail, I remember in older kernel,
some operations should be done such as compute_block. Am I right?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Does raid5 have error handling while reading?
2009-05-22 8:10 Does raid5 have error handling while reading? Xu Yuehai
@ 2009-05-22 8:35 ` NeilBrown
2009-05-22 9:13 ` Xu Yuehai
0 siblings, 1 reply; 4+ messages in thread
From: NeilBrown @ 2009-05-22 8:35 UTC (permalink / raw)
To: Xu Yuehai; +Cc: linux-raid, Trace Green
On Fri, May 22, 2009 6:10 pm, Xu Yuehai wrote:
> I know that if the read request of raid5 is handled by
> chunk_aligned_read, there is no error handling in raid5. But, if this
> read request is not aligned, that's say, raid5 need stripe_head to
> deal with this request. I find in the code of 2.6.27 that there is no
> error handling if this read request fail, I remember in older kernel,
> some operations should be done such as compute_block. Am I right?
If chunk_aligned_read results in an error, then the request
is re-tried through the stripe cache. I would call that "error handling".
If the cache finds that a drives is failed, the data is calculated
from the other drives, though the code is not a straight forward
as it used to be.
See fetch_block5 which sets STRIPE_OP_COMPUTE_BLK which causes
ops_run_compute5 to do the work (or to schedule the work on separate
hardware).
NeilBrown
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Does raid5 have error handling while reading?
2009-05-22 8:35 ` NeilBrown
@ 2009-05-22 9:13 ` Xu Yuehai
2009-05-22 11:21 ` NeilBrown
0 siblings, 1 reply; 4+ messages in thread
From: Xu Yuehai @ 2009-05-22 9:13 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid, green.trace
>
> If chunk_aligned_read results in an error, then the request
> is re-tried through the stripe cache. I would call that "error handling".
I think you mean that error() and raid5_align_endio are invoked and
the read request is sent to conf->retry_read_aligned_list, then the
raid5d will handle it.
> If the cache finds that a drives is failed, the data is calculated
> from the other drives, though the code is not a straight forward
> as it used to be.
> See fetch_block5 which sets STRIPE_OP_COMPUTE_BLK which causes
> ops_run_compute5 to do the work (or to schedule the work on separate
> hardware).
>
I notice that the bit STRIPE_OP_COMPUTE_BLK is set if only s->uptodate
== disks - 1, however, suppose there is just a single read request, I
fail to find out why this condition is satisfied.
Yuehai
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Does raid5 have error handling while reading?
2009-05-22 9:13 ` Xu Yuehai
@ 2009-05-22 11:21 ` NeilBrown
0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2009-05-22 11:21 UTC (permalink / raw)
To: Xu Yuehai; +Cc: linux-raid, green.trace
On Fri, May 22, 2009 7:13 pm, Xu Yuehai wrote:
>>
>> If chunk_aligned_read results in an error, then the request
>> is re-tried through the stripe cache. I would call that "error
>> handling".
>
> I think you mean that error() and raid5_align_endio are invoked and
> the read request is sent to conf->retry_read_aligned_list, then the
> raid5d will handle it.
Yes, that sounds right.
>
>> If the cache finds that a drives is failed, the data is calculated
>> from the other drives, though the code is not a straight forward
>> as it used to be.
>> See fetch_block5 which sets STRIPE_OP_COMPUTE_BLK which causes
>> ops_run_compute5 to do the work (or to schedule the work on separate
>> hardware).
>>
> I notice that the bit STRIPE_OP_COMPUTE_BLK is set if only s->uptodate
> == disks - 1, however, suppose there is just a single read request, I
> fail to find out why this condition is satisfied.
If there is just one read for a block on a device that has failed,
then fetch_block5 will schedule read requests (Wantread) on all
the other devices. Once all those reads complete Uptodate will
be set, so s->update will indeed equal disks - 1, and so
COMPUTE_BLK will get set.
NeilBrown
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-22 11:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 8:10 Does raid5 have error handling while reading? Xu Yuehai
2009-05-22 8:35 ` NeilBrown
2009-05-22 9:13 ` Xu Yuehai
2009-05-22 11:21 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox