Hi there,

WARNING: IANAKH (I am not a kernel hacker)

I wanted to upgrade some of my machines to kernel 2.2.16, so I set about
trying to get mingo's patch for 2.2.15 to apply cleanly to 2.2.16.

WARNING #2: I have practically zero experience with diff -c or patch, but
I thought I would attempt it anyway :)

I altered the patch by hand (which was an interesting experience) and
inserting a new section using diff -c (on drivers/block/md.c).

I have attached the diff file to alter the patch (7.1KB).

The procedure for patching kernel 2.2.16 is:

1) Download http://www.redhat.com/~mingo/raid-patches/raid-2.2.15-A0
2) patch -p0 < raid-2.2.15-to-2.2.16
3) mv raid-2.2.15-A0 raid-2.2.16-A0
4) patch -p0 < raid-2.2.16-A0

As for the changes I've made, they affect:


a) include/linux/sysctl.h

some extra values were added to /proc/sys/dev/cdrom, which screwed up the
context

b) drivers/block/md.c

One line was added, but this screwed up the context, I fixed it by
comparing the patched md.c from 2.2.15 to the unpatched md.c from 2.2.16,
and inserting it manually into the kernel patch.

This resulted in lots of changed line numbers!

c) arch/sparc64/kernel/sparc64_ksyms.c

the 2.2.15 patch changed this file (don't know why) by adding some sub
called VISenter. This has already been added to 2.2.16, so I removed it
from the patch.


I've forwarded this to the list in the hope that it will help other
people, and maybe save a bit of time for one of the real RAID developers.

Sorry if I've screwed up!

Regards,

Corin

PS I've checked that 2.2.16 compiles cleanly after the patch, but I
haven't given my RAID partitions a thorough check. I'll report back if I
have any problems.

/------------------------+-------------------------------------\
| Corin Hartland-Swann   | Mobile: +44 (0) 79 5854 0027        |
| Commerce Internet Ltd  |    Tel: +44 (0) 20 7491 2000        |
| 22 Cavendish Buildings |    Fax: +44 (0) 20 7491 2010        |
| Gilbert Street         |                                     |
| Mayfair                |    Web: http://www.commerce.uk.net/ |
| London W1Y 1FE         | E-Mail: [EMAIL PROTECTED]        |
\------------------------+-------------------------------------/
*** raid-2.2.15-A0      Thu Jun  8 18:03:28 2000
--- raid-2.2.16-A0      Thu Jun  8 18:10:20 2000
***************
*** 2355,2361 ****
  -#endif
  --- linux/include/linux/sysctl.h.orig Wed Apr 12 01:11:00 2000
  +++ linux/include/linux/sysctl.h      Wed Apr 12 01:12:01 2000
! @@ -429,12 +429,18 @@
   /* CTL_DEV names: */
   enum {
        DEV_CDROM=1,
--- 2355,2361 ----
  -#endif
  --- linux/include/linux/sysctl.h.orig Wed Apr 12 01:11:00 2000
  +++ linux/include/linux/sysctl.h      Wed Apr 12 01:12:01 2000
! @@ -429,17 +429,23 @@
   /* CTL_DEV names: */
   enum {
        DEV_CDROM=1,
***************
*** 2366,2372 ****
   
   /* /proc/sys/dev/cdrom */
   enum {
!       DEV_CDROM_INFO=1
  +};
  +
  +/* /proc/sys/dev/md */
--- 2366,2377 ----
   
   /* /proc/sys/dev/cdrom */
   enum {
!       DEV_CDROM_INFO=1,
!       DEV_CDROM_AUTOCLOSE=2,
!       DEV_CDROM_AUTOEJECT=3,
!       DEV_CDROM_DEBUG=4,
!       DEV_CDROM_LOCK=5,
!       DEV_CDROM_CHECK_MEDIA=6
  +};
  +
  +/* /proc/sys/dev/md */
***************
*** 3909,3915 ****
      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2, or (at your option)
! @@ -26,807 +22,3007 @@
      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
   */
   
--- 3914,3920 ----
      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2, or (at your option)
! @@ -26,809 +22,3007 @@
      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
   */
   
***************
*** 4633,4638 ****
--- 4638,4647 ----
  -  
  -  factor = min = 1 << FACTOR_SHIFT(FACTOR((md_dev+minor)));
  -  
+ -  md_blocksizes[minor] <<= FACTOR_SHIFT(FACTOR((md_dev+minor)));
+ +#define BAD_MINOR KERN_ERR \
+ +"md: %s: invalid raid minor (%x)\n"
+  
  -  for (i=0; i<md_dev[minor].nb_dev; i++)
  -    if (md_dev[minor].devices[i].size<min)
  -    {
***************
*** 4655,4662 ****
  -   */ 
  -  if (analyze_sbs(minor, pnum))
  -    return -EINVAL;
! +#define BAD_MINOR KERN_ERR \
! +"md: %s: invalid raid minor (%x)\n"
   
  -  md_dev[minor].pers=pers[pnum];
  -  
--- 4664,4671 ----
  -   */ 
  -  if (analyze_sbs(minor, pnum))
  -    return -EINVAL;
! +#define OUT_OF_MEM KERN_ALERT \
! +"md: out of memory.\n"
   
  -  md_dev[minor].pers=pers[pnum];
  -  
***************
*** 4682,4697 ****
  -  read_ahead[MD_MAJOR] = 128;
  -  return (0);
  -}
- +#define OUT_OF_MEM KERN_ALERT \
- +"md: out of memory.\n"
- +
  +#define NO_SB KERN_ERR \
  +"md: disabled device %s, could not read superblock.\n"
!  
! -static int do_md_stop (int minor, struct inode *inode)
  +#define BAD_CSUM KERN_WARNING \
  +"md: invalid superblock checksum on %s\n"
! +
  +static int alloc_array_sb (mddev_t * mddev)
   {
  -     int i;
--- 4691,4703 ----
  -  read_ahead[MD_MAJOR] = 128;
  -  return (0);
  -}
  +#define NO_SB KERN_ERR \
  +"md: disabled device %s, could not read superblock.\n"
! +
  +#define BAD_CSUM KERN_WARNING \
  +"md: invalid superblock checksum on %s\n"
!  
! -static int do_md_stop (int minor, struct inode *inode)
  +static int alloc_array_sb (mddev_t * mddev)
   {
  -     int i;
***************
*** 4855,4860 ****
--- 4861,4871 ----
  +     bh = bread (dev, sb_offset / MD_SB_BLOCKS, MD_SB_BYTES);
   
  -     if (hot_add) {
+ -             /*
+ -              * Check the superblock for consistency.
+ -              * The personality itself has to check whether it's getting
+ -              * added with the proper flags.  The personality has to be
+ -                 * checked too. ;)
  +     if (bh) {
  +             sb = (mdp_super_t *) bh->b_data;
  +             memcpy (rdev->sb, sb, MD_SB_BYTES);
***************
*** 6213,6223 ****
  +                             md_list_add(&rdev->pending, &candidates);
  +                     }
  +             }
!               /*
! -              * Check the superblock for consistency.
! -              * The personality itself has to check whether it's getting
! -              * added with the proper flags.  The personality has to be
! -                 * checked too. ;)
  +              * now we have a set of devices, with all of them having
  +              * mostly sane superblocks. It's time to allocate the
  +              * mddev.
--- 6224,6230 ----
  +                             md_list_add(&rdev->pending, &candidates);
  +                     }
  +             }
! +             /*
  +              * now we have a set of devices, with all of them having
  +              * mostly sane superblocks. It's time to allocate the
  +              * mddev.
***************
*** 7511,7517 ****
        ret = kernel_thread(md_thread, thread, 0);
        if (ret < 0) {
                kfree(thread);
! @@ -836,270 +3032,407 @@
        return thread;
   }
   
--- 7518,7524 ----
        ret = kernel_thread(md_thread, thread, 0);
        if (ret < 0) {
                kfree(thread);
! @@ -838,270 +3032,407 @@
        return thread;
   }
   
***************
*** 8111,8117 ****
                        if (curr_bsize > blocksize)
                                /*
                                 * this is safe, rounds downwards.
! @@ -1109,114 +3442,384 @@
                                j *= blocksize/curr_bsize;
   
                        blocksize = curr_bsize;
--- 8118,8124 ----
                        if (curr_bsize > blocksize)
                                /*
                                 * this is safe, rounds downwards.
! @@ -1111,114 +3442,384 @@
                                j *= blocksize/curr_bsize;
   
                        blocksize = curr_bsize;
***************
*** 8550,8556 ****
   {
        int i;
        for(i=0;i<=ints[0];i++) {
! @@ -1228,21 +3831,24 @@
        return;
   }
   
--- 8557,8563 ----
   {
        int i;
        for(i=0;i<=ints[0];i++) {
! @@ -1230,21 +3831,24 @@
        return;
   }
   
***************
*** 8580,8586 ****
                return;
        }
   
! @@ -1252,18 +3858,20 @@
        case -1:
   #ifdef CONFIG_MD_LINEAR
                pers = LINEAR;
--- 8587,8593 ----
                return;
        }
   
! @@ -1254,18 +3858,20 @@
        case -1:
   #ifdef CONFIG_MD_LINEAR
                pers = LINEAR;
***************
*** 8605,8611 ****
                        "Recompile the kernel with striped mode enabled!\n");
   #endif
                break;
! @@ -1278,79 +3886,145 @@
                break;
   */
        default:           
--- 8612,8618 ----
                        "Recompile the kernel with striped mode enabled!\n");
   #endif
                break;
! @@ -1280,79 +3886,145 @@
                break;
   */
        default:           
***************
*** 15235,15260 ****
   CONFIG_BLK_DEV_RAM=y
   CONFIG_BLK_DEV_INITRD=y
   CONFIG_BLK_DEV_LOOP=m
- --- linux/arch/sparc64/kernel/sparc64_ksyms.c.orig    Wed Apr 12 01:11:00 2000
- +++ linux/arch/sparc64/kernel/sparc64_ksyms.c Wed Apr 12 01:12:01 2000
- @@ -81,6 +81,7 @@
-  extern int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-  extern int sys32_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
-  extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
- +extern void VISenter(void);
-                  
-  extern void bcopy (const char *, char *, int);
-  extern int __ashrdi3(int, int);
- @@ -298,6 +299,9 @@
-   * and will always be 'void __ret_efault(void)'.
-   */
-  EXPORT_SYMBOL_NOVERS(__ret_efault);
- +/* VISenter is defined in assembly as well.
- + */
- +EXPORT_SYMBOL_NOVERS(VISenter);
-  
-  /* No version information on these, as gcc produces such symbols. */
-  EXPORT_SYMBOL_NOVERS(memcmp);
  --- linux/arch/sparc64/config.in.orig Wed Apr 12 01:11:00 2000
  +++ linux/arch/sparc64/config.in      Wed Apr 12 01:12:01 2000
  @@ -97,10 +97,16 @@
--- 15242,15247 ----

Reply via email to