Re: Re: fr1-2.16 patch for 2.6.10 kernel
denis bonnenfant <[email protected]>
| Newsgroups | gmane.linux.enbd.general |
|---|---|
| Message-ID | <[email protected]> |
>>So i suggest :
>>#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 == *rdevp) {
>
>
> Yes - this was the intention. It seems to be like that in my source
> code, so the problem seems to be that I hand-edited the patch looking
> at the source, and did not catch up with the source properly.
> But what sets *rdevp before the call to map()?
>
> I see that in my source there is:
>
> #ifdef CONFIG_MD_RAID1_ROBUST_READ
> rdev = conf->mirrors[r1_bio->read_disk].rdev;
> #endif /* CONFIG_MD_RAID1_ROBUST_READ */
> if ((disk=map(mddev, &rdev)) == -1) {
> printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
> " read error for block %llu\n",
>
> So it looks like I set it, but I doubt that is in the patch.
Exactly, and the bug was there ! Now i can cycle fails/adds without
crashing ! But now it seems that clean sectors are not skipped....
Just another point : in map(), don't really understand these lines :
if (i >= disks)
i = 0;
for (; i < disks; i++) {
mdk_rdev_t *rdev = conf->mirrors[i].rdev;
if (rdev && rdev != *rdevp && rdev->in_sync){
^^^^ Here ! maybe i ?
*rdevp = rdev;
atomic_inc(&rdev->nr_pending);
spin_unlock_irq(&conf->device_lock);
return i;
}