Re: [RFC][PATCH] identify raid rcu-protected pointer

From: Suzanne Wood
Date: Tue Oct 11 2005 - 17:35:26 EST


To provide further background to the recently submitted patch,
please let me note the following in regard to the commented
question in read_balance() of raid1.c

diff linux-2.6.13-rc6/drivers/md/raid1.c linux-2.6.14-rc4/drivers/md/raid1.c

changed to 379,383c419,428
< while ((new_rdev=conf->mirrors[new_disk].rdev) == NULL ||
< !new_rdev->in_sync) {
< new_disk++;
< if (new_disk == conf->raid_disks) {
< new_disk = -1;
---
> for (rdev = conf->mirrors[new_disk].rdev;
> !rdev || !rdev->in_sync
> || test_bit(WriteMostly, &rdev->flags);
> rdev = conf->mirrors[++new_disk].rdev) {
>
> if (rdev && rdev->in_sync)
> wonly_disk = new_disk;
>
> if (new_disk == conf->raid_disks - 1) {
> new_disk = wonly_disk;
392,393c437,444
< while ((new_rdev=conf->mirrors[new_disk].rdev) == NULL ||
< !new_rdev->in_sync) {
---
> for (rdev = conf->mirrors[new_disk].rdev;
> !rdev || !rdev->in_sync ||
> test_bit(WriteMostly, &rdev->flags);
> rdev = conf->mirrors[new_disk].rdev) {
>

On the second revision section, one would consider rcu_dereference()
on both "rdev =" occurrences, but expr3 is not apparently changing, so
comparing it to the earlier "for loop" elicits my question.
Thank you.
Suzanne

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/