All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jianpeng Ma" <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: Re: [PATCH] raid5: Avoid doing more read on dev of a stripe at the same time
Date: Fri, 21 Sep 2012 10:24:45 +0800	[thread overview]
Message-ID: <201209211024418590971@gmail.com> (raw)
In-Reply-To: 20120920132422.0f7841f1@notabene.brown

On 2012-09-20 11:24 NeilBrown <neilb@suse.de> Wrote:
>On Thu, 20 Sep 2012 11:04:46 +0800 "Jianpeng Ma" <majianpeng@gmail.com> wrote:
>
>> On 2012-09-20 10:51 NeilBrown <neilb@suse.de> Wrote:
>> >On Sat, 15 Sep 2012 10:20:35 +0800 "Jianpeng Ma" <majianpeng@gmail.com> wrote:
>> >
>> >> In func 'ops_run_bio' if you read the dev which the last reading
>> >> of this dev didn't return,it will destrory the  req/rreq'source of rdev.
>> >> It may call hung-task.
>> >> For example, for badsector or other reasons, read-operation only used
>> >> stripe instead of chunk_aligned_read.
>> >> First:stripe 0;second: stripe 8;third:stripe 16.At the block-layer,three
>> >> bios merged.
>> >> Because media error of sector from 0 to 7, the request retried.
>> >> At this time, raid5d readed stripe0 again.But it will set 'bio->next =
>> >> NULL'.So the stripe 8 and 16 didn't return.
>> >> 
>> >> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
>> >
>> >Hi,
>> > I'm really trying, but I cannot understand what you are saying.
>> >
>> Sorry for my bad english.
>> >I think the situation that you are describing involves a 24 sector request.
>> >This is attached to 3 stripe_heads - 8 sectors each - at address 0, 8, 16.
>> >
>> >So 'toread' on the first device of each stripe points to this bio, and
>> >bi_next is NULL.
>> >
>> >The "req" bio for each device is filled out to read one page and these three
>> >'req' bios are submitted.  The block layer merges these into a single request.
>> >
>> >This request reports an error because there is a read error somewhere in the
>> >first  8 sectors.
>> >
>> Yes,
>> >So one, or maybe all, of the 'req' bios return with an error?
>> From my test, when req did not return and at the same time, the bio(stripe 0) send.
>> So this operation will set bi_next is NULL.
>
>Are you saying that we send another bio before the first one has returned?
>That shouldn't be possible as sh->count will prevent it from happening.
>While there is an outstanding request, sh->count will be >0, and until
>sh->count is 0, we won't try to send any more requests.
>
>So I still don't understand.  Please try to provide as much detail as
>possible.  If it is easier, write in your own language and use
>translate.google.com to convert to english. ??
>
>Thanks,
>NeilBrown

Hi,
 i wrote a shell-script can reproduct this bug.
Note: mdadm -V
mdadm - v3.3-pre - Unreleased


#!/bin/bash

declare -i count
declare -i sector
count=0
sector=2048
while true
do
	hdparm --make-bad-sector $sector --yes-i-know-what-i-am-doing /dev/sdc > /dev/null
	hdparm --make-bad-sector $sector --yes-i-know-what-i-am-doing /dev/sdd > /dev/null
	hdparm --make-bad-sector $sector --yes-i-know-what-i-am-doing /dev/sde > /dev/null
	let count++
	let sector+=$count*8
	if (($count == 40));then
		break
	fi
done

while true
do
	mdadm -S /dev/md0
	mdadm -CR /dev/md0 -l5 -c4 -n4 missing /dev/sd[cde]
	dd if=/dev/md0 of=/dev/null bs=10M count=1 iflag=direct
	sleep 1
done


Thanks

  parent reply	other threads:[~2012-09-21  2:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15  2:20 [PATCH] raid5: Avoid doing more read on dev of a stripe at the same time Jianpeng Ma
2012-09-20  2:51 ` NeilBrown
2012-09-20  3:04   ` Jianpeng Ma
2012-09-20  3:24     ` NeilBrown
2012-09-20  6:04       ` Jianpeng Ma
2012-09-21  2:24       ` Jianpeng Ma [this message]
2012-09-25  7:29         ` NeilBrown
2012-09-26  2:43           ` NeilBrown
2012-09-26  4:09             ` Jianpeng Ma
2012-09-26  9:14             ` Jianpeng Ma

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=201209211024418590971@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.