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]:"
> Selon [email protected]:

Sorry, I didn't see this note before ...

> with this file, I have this : 
> 
>   CC [M]  drivers/md/raid1.o
> drivers/md/raid1.c: In function `map':
> drivers/md/raid1.c:246: structure has no member named `operational'

Well, that's just a hangover from using an old out of date comparator
construct in the loop. Borrw instead from the loop below. I am bck to
preferring "&& redev != *rdevp", by the way, having studied the code
again, this time checking the calling points too.

        if (i >= disks)
                i = 0;
        for (; i < disks; i++) {
                mdk_rdev_t *rdev = conf->mirrors[i].rdev;
                if (rdev && rdev != *rdevp && rdev->in_sync) {
                        *rdevp = rdev;
                        atomic_inc(&rdev->nr_pending);
                        spin_unlock_irq(&conf->device_lock);
                        return i;
                }
        }

The count will be right whatever one does, because it is incremented on
the target device eventually selected, of which there is only one. It's
just a question of getting to select the right device. The question is
if one should be allowed to fail here. I rather imagine one should,
when one has run out of disks to try, and one should not drop into the
old choice of disk (any old disk will do) as it may choose the same
disk again and again  ... (maybe, I suppose there is some limiter
somewhere on the count). So maybe:

       return -1;

could be helpful?

We do have some responsibility here, because we decided not to fault an
erroring disk, so we have to make sure it is not rechosen as a target
in a retry. On the other hand, if we chose the original again after
already having tried all the rest, so what? We'll just error again.
Yes, there is a counter on the request, and it will run out. We just
have to make a best effort not to use up all the tries remaining
to us uselessly.  So we can afford to say "no more" OR give up after
having tried everything we could do and let the original algorithm
choose a disk now, since we can't find one.  Its choice will be useless
too.

> drivers/md/raid1.c: In function `sync_request':
> drivers/md/raid1.c:1479: warning: passing arg 1 of `md_sync_acct' from
> incompatible pointer type

That needs investigation. The arg looks like it needs to be
"mirror->rdev" in 2.6.8.1. Has it changed?

> drivers/md/raid1.c: At top level:
> drivers/md/raid1.c:220: warning: `map' defined but not used

You have to find what it has been renamed to!


> make[3]: *** [drivers/md/raid1.o] Error 1
> make[2]: *** [drivers/md] Error 2
> make[1]: *** [drivers] Error 2
> make[1]: Leaving directory `/var/se3/src/kernel-source-2.6.10'
> make: *** [stamp-build] Error 2

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.