From: Michael Tokarev <mjt@tls.msk.ru>
To: Neil Brown <neilb@suse.de>
Cc: Eli Stair <estair@ilm.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: Fix bug where new drives added to an md array sometimes don't sync properly.
Date: Thu, 12 Oct 2006 14:02:25 +0400 [thread overview]
Message-ID: <452E12B1.1070506@tls.msk.ru> (raw)
In-Reply-To: <17706.65210.999441.373846@cse.unsw.edu.au>
Neil Brown wrote:
[]
> Fix count of degraded drives in raid10.
>
> Signed-off-by: Neil Brown <neilb@suse.de>
>
> --- .prev/drivers/md/raid10.c 2006-10-09 14:18:00.000000000 +1000
> +++ ./drivers/md/raid10.c 2006-10-05 20:10:07.000000000 +1000
> @@ -2079,7 +2079,7 @@ static int run(mddev_t *mddev)
> disk = conf->mirrors + i;
>
> if (!disk->rdev ||
> - !test_bit(In_sync, &rdev->flags)) {
> + !test_bit(In_sync, &disk->rdev->flags)) {
> disk->head_position = 0;
> mddev->degraded++;
> }
Neil, this makes me nervous. Seriously.
How many bugs like this has been fixed so far? 10? 50? I stopped counting
long time ago. And it's the same thing in every case - misuse of rdev vs
disk->rdev. The same pattern.
I wonder if it can be avoided in the first place somehow - maybe don't
declare and use local variable `rdev' (not by name, but by the semantics
of it), and always use disk->rdev or mddev->whatever in every place,
explicitly, and let the compiler optimize the deref if possible?
And btw, this is another 2.6.18.1 candidate (if it's not too late already).
Thanks.
/mjt
next prev parent reply other threads:[~2006-10-12 10:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20061005171233.6542.patches@notabene>
2006-10-05 7:13 ` [PATCH] md: Fix bug where new drives added to an md array sometimes don't sync properly NeilBrown
2006-10-05 19:26 ` Eli Stair
2006-10-06 22:42 ` Eli Stair
2006-10-10 2:00 ` Neil Brown
2006-10-10 20:42 ` Eli Stair
2006-10-11 0:00 ` Eli Stair
2006-10-12 10:02 ` Michael Tokarev [this message]
2006-10-17 0:13 ` Neil Brown
2006-10-18 22:18 ` Eli Stair
2006-10-20 3:24 ` Neil Brown
2006-10-10 20:20 ` Eli Stair
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=452E12B1.1070506@tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=estair@ilm.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.