home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!ra!tantalus!eric
- From: eric@tantalus.dell.com (Eric Youngdale)
- Newsgroups: comp.os.linux
- Subject: Re: 0.97pl4 breaks SCSI extended partition code
- Message-ID: <3555@ra.nrl.navy.mil>
- Date: 9 Sep 92 22:34:21 GMT
- References: <3541@ra.nrl.navy.mil> <716098399snx@prism.demon.co.uk>
- Sender: usenet@ra.nrl.navy.mil
- Organization: Naval Research Laboratory
- Lines: 88
-
- In article <716098399snx@prism.demon.co.uk> david@prism.demon.co.uk (David Metcalfe) writes:
- >I have now confirmed that my problem occurs in exactly the same
- >place. The values of the key variables with pl4 (the one that fails)
- >are
- >
- >blk_size[major][MINOR(bh->b_dev)] = 0
- >sector = 0
- >count = 2
- >
- >When I repeat the same exercise with pl2 (which works), the values of
- >the variables on the first pass through the routine are
- >
- >blk_size[major][MINOR(bh->b_dev)] = 507905
- >sector = 0
- >count = 2
- >
- >So the problem would appear to be with the blk_size array. I will
- >leave someone else to work out what the problem is because I'm not
- >really a kernel hacker :-)
-
- OK, I think I see what the problem is, and why this is not working.
- I suggest the following patch. I already gave this patch to Chris Newbold,
- and it looks correct enough for me to release to the public.
-
- Basically this corrects a problem where linux has difficulty reading
- the partition table for an extended partition. If you are not having this
- problem, I do not see much point in trying this.
-
- Basically the problem is that the sd_sizes array is normally
- initialized after the partition tables have been read. Normally
- blk_size[MAJOR] should be 0 until the sizes array is ready, but for
- scsi disks blk_size[8] was being initialized prematurely, leading to the
- problem in make_request (As long as blk_size[MAJOR] == 0, testing
- of sd_sizes is inhibited).
-
- -Eric
-
- *** sd.c.~1~ Tue Jul 28 19:31:23 1992
- --- sd.c Wed Sep 9 17:18:37 1992
- ***************
- *** 38,44 ****
-
- int NR_SD=0;
- Scsi_Disk rscsi_disks[MAX_SD];
- ! static int sd_sizes[MAX_SD << 4];
- static int this_count;
- static int the_result;
-
- --- 38,44 ----
-
- int NR_SD=0;
- Scsi_Disk rscsi_disks[MAX_SD];
- ! static int sd_sizes[MAX_SD << 4] = {0, };
- static int this_count;
- static int the_result;
-
- ***************
- *** 56,64 ****
- static void sd_geninit (void) {
- int i;
- for (i = 0; i < NR_SD; ++i)
- ! sd_sizes[i << 4] =
- ! (sd[i << 4].nr_sects = rscsi_disks[i].capacity) >>
- ! (BLOCK_SIZE_BITS - 9);
- sd_gendisk.nr_real = NR_SD;
- }
-
- --- 56,62 ----
- static void sd_geninit (void) {
- int i;
- for (i = 0; i < NR_SD; ++i)
- ! sd[i << 4].nr_sects = rscsi_disks[i].capacity;
- sd_gendisk.nr_real = NR_SD;
- }
-
- ***************
- *** 414,420 ****
- }
-
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
- - blk_size[MAJOR_NR] = sd_sizes;
- blkdev_fops[MAJOR_NR] = &sd_fops;
- sd_gendisk.next = gendisk_head;
- gendisk_head = &sd_gendisk;
- --- 412,417 ----
- --
- Eric Youngdale
- eric@tantalus.nrl.navy.mil
-