Re: problems compiling enbd-2.4.32pre and fr1-2.16 under kernel 2.6.8.1

[email protected] (Peter T. Breuer)
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
In article <[email protected]> you wrote:
> hi

Hi.

> i have a few problems when compiling the
> enbd-2.4.32pre and fr1-2.16, 

On ...

> using the kernel source 2.6.8.1 .

Oh.

> 1. when compiling the enbd without patching the kernel
> source, i found
>    a typo @ line 309, in the
> ./nbd-2.4.32/kernel/linux-2.6.x/Makefile. 
>    this is easy to correct

This line is:

# Helpers built in scripts/

$(srctree)/scripts/docproc $(srctree)/scripts/split-include : $(srctree)/)scripts ;

(it's the line above). Ah. Extra paren? Well done. I wonder where that
came from!


>    
>    $(srctree)/scripts/docproc
> $(srctree)/scripts/split-include : $(srctree)/)scripts
> ;

Yes.


> 2. after i modified the Makefile and compiled it
> again, the make said she 
>    could not find
> ./nbd-2.4.32/kernel/linux-2.6.x/scripts/fixdep.c,
> which's 
>    needed to build fixdep. this time i don't know how
> to fix it. 

This is part of your kernel source. It comes from there. I don't think
you would normally need it, since it would be in the kernel dir.

>    so i patched the kernel and built it, it seems ok.

There's no need to do that. I'm more interested in why you don't have
fixdep.c.

  % locate fixdep.c
  /usr/local/src/linux-2.6.0-test2/scripts/fixdep.c
  /usr/local/src/linux-2.6.1/scripts/fixdep.c
  /usr/local/src/linux-2.6.3/scripts/fixdep.c
  /usr/local/src/linux-2.6.8.1-uml/scripts/basic/fixdep.c

etc. If you don't have it, you don't have kernel source, so how can you
compile?


> 3. when compiling the fr1 driver with raid1 robust
> read enabled, i found
>    a undeclared var 'rdev' in function map in raid1.c.

Oh, that's an old one. It was supposed to be *rdevp. It's been fixed in
FR1 patches for a while.

> i checked the mailing
>    list and found the solution. so it's ok.

Did you add the other change needed? The one that adds an assignment to
rdev before calling  map?

@@ -925,6 +1249,9 @@
                } else {
                        int disk;
                        bio = r1_bio->bios[r1_bio->read_disk];
+#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",

The latest FR1 patch should have both things in.



> 4. then i rebuilt the kernel. and this time, every
> thing seemed to be fine
>    except there is an undefined symbole '__udivdi3' in
> the md.c @ line 3692

This comes from your compiler not doing division adequately.

>    
>    realspeed = (j - mddev->resync_mark_cnt -
> atomic_read(&md_throttle[mddev->md_minor]))/2/((jiffies-mddev->resync_mark)/HZ
> +1) +1;
>    
>    how could i get rid of that?

Fix compiler! It probably can't divide by a variable value. But anyway,
why isn't it foxed by the line before?

                currspeed = (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;
#ifdef MD_BITMAP_SUPPORT
                /*
                 * PTB some of the blocks are skipped, not synced, so
                 * should not count when limiting i/o. Let personality
                 * say.
                 */
                realspeed = (j - mddev->resync_mark_cnt - atomic_read(&md_thrott
le[mdidx(mddev)]))/2/((jiffies-mddev->resync_mark)/HZ +1) +1;
#endif /* MD_BITMAP_SUPPORT */

The only difference between the currspeed and realspeed calculations is
the "- atomic_read(&md_throttle[mdidx(mddev)]" in the numerator. If
your compiler does one without problems, the other should also be no
problem to it!

So split the calculation up a bit and see if you can help the compiler
out. What compiler is it?


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.