On Sun, Jan 02, 2000 at 06:22:05PM -0800, Andrew Biddle wrote: > Actually, I'm having the same problem as the original poster, so I'll > provide some details... > > Patching the 2.2.13 kernel to pre-2.2.14-18 compiles properly, yielding > the expected kernel. Then I apply the raid0145-19990824-2.2.11 patch. > A "make dep; make clean" results in no errors, but the "make bzImage" > errors out during compile-time with the following errors: > > raid0.c:225: warning: `struct md_dev' declared inside parameter list > raid0.c:225: warning: its scope is only this definition or > declaration, [snip] > I'm far, far over my head trying to figure out the problem other than > the fact it looks like the two patches aren't compatible. I do agree > that the order of the patches appears to be irrelevent since I've done > them both ways and both error out... > > If anyone has a solution for this, I'd love to hear it. I NEED > pre-2.2.14-18 in order to get a couple new drives recognized properly > and I was hoping to also be able to RAID-0 them as well... It's a patch; it's fairly fundamental that if two patches aren't made off the same source, there's the distinct possibility that you can't apply them both cleanly. That's what you use .rej files for: Your only real option is to merge the contents of the .rej files by hand after applying the second patch, as so: After applying both patches: infocalypse:/usr/src/linux# find . -name '*.rej' ./include/asm-ppc/md.h.rej ./drivers/block/raid0.c.rej ./arch/sparc64/kernel/ioctl32.c.rej Since I'm on x86, I don't for the moment care if my kernel works on other archs, so I can ignore the first and last .rej. That just leaves raid0.c.rej. So, time to hand-merge the changes. In this case, the easiest thing is to cut out everything from the start of the decl for raid0_map through the end of cleanup_module, and cut and paste the new version of the code from the patch. After a quick snip in emacs, it's done, and the kernel compiles. Attached is another patch you can apply afterwards directly to the post- patching un-hand-merged raid0.c to accomplish the same fix. -- Elie Rosenblum That is not dead which can eternal lie, http://www.cosanostra.net And with strange aeons even death may die. Admin / Mercenary / System Programmer - _The Necronomicon_
224c224 < static int raid0_map (struct md_dev *mddev, kdev_t *rdev, --- > static int raid0_map (mddev_t *mddev, kdev_t dev, kdev_t *rdev, 227,264c227,254 < struct raid0_data *data=(struct raid0_data *) mddev->private; < static struct raid0_hash *hash; < struct strip_zone *zone; < struct real_dev *tmp_dev; < int blk_in_chunk, factor, chunk, chunk_size; < long block, rblock; < < factor=FACTOR(mddev); < chunk_size=(1UL << FACTOR_SHIFT(factor)); < block=*rsector >> 1; < hash=data->hash_table+(block/data->smallest->size); < < if (hash - data->hash_table > data->nr_zones) < { < printk(KERN_DEBUG "raid0_map: invalid block %ul\n", block); < return -1; < } < < /* Sanity check */ < if ((chunk_size*2)<(*rsector % (chunk_size*2))+size) < { < printk ("raid0_convert : can't convert block across chunks or bigger than %dk %ld %ld\n", chunk_size, *rsector, size); < return (-1); < } < < if (block >= (hash->zone0->size + < hash->zone0->zone_offset)) < { < if (!hash->zone1) < { < printk ("raid0_convert : hash->zone1==NULL for block %ld\n", block); < return (-1); < } < < zone=hash->zone1; < } < else < zone=hash->zone0; --- > raid0_conf_t *conf = mddev_to_conf(mddev); > struct raid0_hash *hash; > struct strip_zone *zone; > mdk_rdev_t *tmp_dev; > int blk_in_chunk, chunksize_bits, chunk, chunk_size; > long block, rblock; > > chunk_size = mddev->param.chunk_size >> 10; > chunksize_bits = ffz(~chunk_size); > block = *rsector >> 1; > hash = conf->hash_table + block / conf->smallest->size; > > /* Sanity check */ > if ((chunk_size * 2) < (*rsector % (chunk_size * 2)) + size) > goto bad_map; > > if (!hash) > goto bad_hash; > > if (!hash->zone0) > goto bad_zone0; > > if (block >= (hash->zone0->size + hash->zone0->zone_offset)) { > if (!hash->zone1) > goto bad_zone1; > zone = hash->zone1; > } else > zone = hash->zone0; 266,269c256,259 < blk_in_chunk=block & (chunk_size -1); < chunk=(block - zone->zone_offset) / (zone->nb_dev<<FACTOR_SHIFT(factor)); < tmp_dev=zone->dev[(block >> FACTOR_SHIFT(factor)) % zone->nb_dev]; < rblock=(chunk << FACTOR_SHIFT(factor)) + blk_in_chunk + zone->dev_offset; --- > blk_in_chunk = block & (chunk_size -1); > chunk = (block - zone->zone_offset) / (zone->nb_dev << chunksize_bits); > tmp_dev = zone->dev[(block >> chunksize_bits) % zone->nb_dev]; > rblock = (chunk << chunksize_bits) + blk_in_chunk + zone->dev_offset; 271,272c261,264 < *rdev=tmp_dev->dev; < *rsector=rblock<<1; --- > *rdev = tmp_dev->dev; > *rsector = rblock << 1; > > return 0; 274c266,277 < return (0); --- > bad_map: > printk ("raid0_map bug: can't convert block across chunks or bigger than %dk >%ld %ld\n", chunk_size, *rsector, size); > return -1; > bad_hash: > printk("raid0_map bug: hash==NULL for block %ld\n", block); > return -1; > bad_zone0: > printk ("raid0_map bug: hash->zone0==NULL for block %ld\n", block); > return -1; > bad_zone1: > printk ("raid0_map bug: hash->zone1==NULL for block %ld\n", block); > return -1; 278c281 < static int raid0_status (char *page, int minor, struct md_dev *mddev) --- > static int raid0_status (char *page, mddev_t *mddev) 280c283 < int sz=0; --- > int sz = 0; 283,284c286,287 < int j, k; < struct raid0_data *data=(struct raid0_data *) mddev->private; --- > int j, k; > raid0_conf_t *conf = mddev_to_conf(mddev); 286,296c289,298 < sz+=sprintf (page+sz, " "); < for (j=0; j<data->nr_zones; j++) < { < sz+=sprintf (page+sz, "[z%d", < data->hash_table[j].zone0-data->strip_zone); < if (data->hash_table[j].zone1) < sz+=sprintf (page+sz, "/z%d] ", < data->hash_table[j].zone1-data->strip_zone); < else < sz+=sprintf (page+sz, "] "); < } --- > sz += sprintf(page + sz, " "); > for (j = 0; j < conf->nr_zones; j++) { > sz += sprintf(page + sz, "[z%d", > conf->hash_table[j].zone0 - conf->strip_zone); > if (conf->hash_table[j].zone1) > sz += sprintf(page+sz, "/z%d] ", > conf->hash_table[j].zone1 - conf->strip_zone); > else > sz += sprintf(page+sz, "] "); > } 298c300 < sz+=sprintf (page+sz, "\n"); --- > sz += sprintf(page + sz, "\n"); 300,311c302,312 < for (j=0; j<data->nr_strip_zones; j++) < { < sz+=sprintf (page+sz, " z%d=[", j); < for (k=0; k<data->strip_zone[j].nb_dev; k++) < sz+=sprintf (page+sz, "%s/", < partition_name(data->strip_zone[j].dev[k]->dev)); < sz--; < sz+=sprintf (page+sz, "] zo=%d do=%d s=%d\n", < data->strip_zone[j].zone_offset, < data->strip_zone[j].dev_offset, < data->strip_zone[j].size); < } --- > for (j = 0; j < conf->nr_strip_zones; j++) { > sz += sprintf(page + sz, " z%d=[", j); > for (k = 0; k < conf->strip_zone[j].nb_dev; k++) > sz += sprintf (page+sz, "%s/", partition_name( > conf->strip_zone[j].dev[k]->dev)); > sz--; > sz += sprintf (page+sz, "] zo=%d do=%d s=%d\n", > conf->strip_zone[j].zone_offset, > conf->strip_zone[j].dev_offset, > conf->strip_zone[j].size); > } 313,314c314,315 < sz+=sprintf (page+sz, " %dk chunks", 1<<FACTOR_SHIFT(FACTOR(mddev))); < return sz; --- > sz += sprintf(page + sz, " %dk chunks", mddev->param.chunk_size/1024); > return sz; 317,318c318 < < static struct md_personality raid0_personality= --- > static mdk_personality_t raid0_personality= 320,332c320,332 < "raid0", < raid0_map, < NULL, /* no special make_request */ < NULL, /* no special end_request */ < raid0_run, < raid0_stop, < raid0_status, < NULL, /* no ioctls */ < 0, < NULL, /* no error_handler */ < NULL, /* hot_add_disk */ < NULL, /* hot_remove_disk */ < NULL /* mark_spare */ --- > "raid0", > raid0_map, > NULL, /* no special make_request */ > NULL, /* no special end_request */ > raid0_run, > raid0_stop, > raid0_status, > NULL, /* no ioctls */ > 0, > NULL, /* no error_handler */ > NULL, /* no diskop */ > NULL, /* no stop resync */ > NULL /* no restart resync */ 335d334 < 340c339 < register_md_personality (RAID0, &raid0_personality); --- > register_md_personality (RAID0, &raid0_personality); 347c346 < return (register_md_personality (RAID0, &raid0_personality)); --- > return (register_md_personality (RAID0, &raid0_personality)); 352c351 < unregister_md_personality (RAID0); --- > unregister_md_personality (RAID0);