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]:"
[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> Selon [email protected]:
> 
> > Selon "Peter T. Breuer" <[email protected]>:
> > 
> > > [email protected] wrote:
> > > > Selon "Peter T. Breuer" <[email protected]>:
> > > > 
> > > > Ok, incremental patch against 2.6.8.1 -> 2.6-10 applies ! 
> > > 
> > > You might want to compile it before claiming so :-). It's likely that
> > > some variable or field names changed and you need to make changes to
> > > match.
> > 
> > My patch apply smoothly against debian-style kernel too.
> > 
> > Compilation (debian-way) is in progress.... Let's wait a little bit
> 
> problem...
> 
>   CC [M]  drivers/md/raid1.o
> drivers/md/raid1.c:63: bitmap.h: No such file or directory

You have missed the bitmap.h file. It's in the archive:

oboe:/usr/oboe/ptb/lang/c/fr1/fr1-2.16% diffstat patches/linux-2.6.8.1.patch 
 drivers/md/Kconfig         |   43 ++
 drivers/md/Makefile        |    1 
 drivers/md/bitmap.c        |  848 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/md/bitmap.h        |   54 ++
 ^^^^^^^^^^^^^^^^^^^^
 drivers/md/md.c            |  297 +++++++++++++++
 drivers/md/raid1.c         |  493 +++++++++++++++++++++++++-
 include/linux/raid/md_k.h  |    6 
 include/linux/raid/md_p.h  |   23 +
 include/linux/raid/raid1.h |   28 +
 9 files changed, 1784 insertions, 9 deletions
oboe:/usr/oboe/ptb/lang/c/fr1/fr1-2.16% 


> drivers/md/raid1.c: In function `map':
> drivers/md/raid1.c:246: structure has no member named `operational'

Curious. What's the code? Is it ...

#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;
                }
        }
        /*
         * If for some reason we fund nothing, dropthru and use the old
         * routine.
         */
#endif /* CONFIG_MD_RAID1_ROBUST_READ */

This alters the map() function to choose the next available disk, not
disk 0 all the time. Looks like my fault. Just look for some loop like
that with "i < disks" in. Just below that code insert there's one:

        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;
                }
        }

Its job is to select a disk if disk 0 is out of commission. We want to
select the "next" disk instead of disk 0, and we just searched through
the current array for the current disk, and incremented by one. Now we
need to check it.

So I would suppose one wants exactly the same loop as would come next,
just with the "i = 0" reset dropped.

#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++) {
                mdk_rdev_t *rdev = conf->mirrors[i].rdev;
                if (rdev && ! rdev->faulty) {
                        *rdevp = rdev;
                        atomic_inc(&rdev->nr_pending);
                        spin_unlock_irq(&conf->device_lock);
                        return i;
                }
        }
        /*
         * If for some reason we fund nothing, dropthru and use the old
         * routine.
         */
#endif /* CONFIG_MD_RAID1_ROBUST_READ */

                    


> drivers/md/raid1.c: In function `raid_end_bio_io':
> drivers/md/raid1.c:308: dereferencing pointer to incomplete type
> drivers/md/raid1.c:309: dereferencing pointer to incomplete type

Well, presumably from the missing header!

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.