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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux