Re: Re: fr1-2.16 patch for 2.6.10 kernel

"Peter T. Breuer" <[email protected]>
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
"Also sprach [email protected]:"
> After patching, i have that : 
> 
> static int map(mddev_t *mddev, mdk_rdev_t **rdevp)
> {
>         conf_t *conf = mddev_to_conf(mddev);
>         int i, disks = conf->raid_disks;
> #ifdef CONFIG_MD_RAID1_ROBUST_READ
>         mdk_rdev_t *rdev = *rdevp;
> #endif /* CONFIG_MD_RAID1_READ_WRITE_CORRECT */

Remove that insertion (above) - not needed.

> 
>         /*
>          * Later we do read balancing on the read side
>          * now we use the first available disk.
>          */
> 
>         spin_lock_irq(&conf->device_lock);
> #ifdef CONFIG_MD_RAID1_ROBUST_READ
>         /*
>          * Uh, no. Choose the next disk if we can, not the first.
>          */
>         for (i = 0; i < disks; i++) {
>                 if (conf->mirrors[i].rdev == rdev) {
>                         i++;
>                         break;
>                 }
>         }
>         if (i >= disks)
>                 i = 0;
>         for (; i < disks; i++) {
>                 if (conf->mirrors[i].operational) {
>                         *rdevp = conf->mirrors[i].rdev;
>                         atomic_inc(&(*rdevp)->nr_pending);
>                         spin_unlock_irq(&conf->device_lock);
>                         return i;
>                 }
>         }

And here (above) use instead the loop from below, but with the "i = 0"
initialization excised.

>         /*
>          * If for some reason we fund nothing, dropthru and use the old
>          * routine.
>          */
> #endif /* CONFIG_MD_RAID1_READ_WRITE_CORRECT */
>         for (i = 0; i < disks; i++) {
>                 mdk_rdev_t *rdev = conf->mirrors[i].rdev;
>                 if (rdev && rdev->in_sync) {
>                         *rdevp = rdev;
>                         atomic_inc(&rdev->nr_pending);
>                         spin_unlock_irq(&conf->device_lock);
>                         return i;
>                 }
>         }
>         spin_unlock_irq(&conf->device_lock);
> 
>         printk(KERN_ERR "raid1_map(): huh, no more operational devices?\n");
>         return -1;
> }
> 

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.