home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10318 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  2.9 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!ra!tantalus!eric
  2. From: eric@tantalus.dell.com (Eric Youngdale)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: 0.97pl4 breaks SCSI extended partition code
  5. Message-ID: <3555@ra.nrl.navy.mil>
  6. Date: 9 Sep 92 22:34:21 GMT
  7. References: <3541@ra.nrl.navy.mil> <716098399snx@prism.demon.co.uk>
  8. Sender: usenet@ra.nrl.navy.mil
  9. Organization: Naval Research Laboratory
  10. Lines: 88
  11.  
  12. In article <716098399snx@prism.demon.co.uk> david@prism.demon.co.uk (David Metcalfe) writes:
  13. >I have now confirmed that my problem occurs in exactly the same
  14. >place.  The values of the key variables with pl4 (the one that fails)
  15. >are
  16. >
  17. >blk_size[major][MINOR(bh->b_dev)] = 0
  18. >sector = 0
  19. >count = 2
  20. >
  21. >When I repeat the same exercise with pl2 (which works), the values of
  22. >the variables on the first pass through the routine are
  23. >
  24. >blk_size[major][MINOR(bh->b_dev)] = 507905
  25. >sector = 0
  26. >count = 2
  27. >
  28. >So the problem would appear to be with the blk_size array.  I will
  29. >leave someone else to work out what the problem is because I'm not
  30. >really a kernel hacker :-)
  31.  
  32.     OK, I think I see what the problem is, and why this is not working.
  33. I suggest the following patch.  I already gave this patch to Chris Newbold,
  34. and it looks correct enough for me to release to the public.
  35.  
  36.     Basically this corrects a problem where linux has difficulty reading
  37. the partition table for an extended partition.  If you are not having this
  38. problem, I do not see much point in trying this.
  39.  
  40.     Basically the problem is that the sd_sizes array is normally
  41. initialized after the partition tables have been read.  Normally
  42. blk_size[MAJOR] should be 0 until  the sizes array is ready, but for
  43. scsi disks blk_size[8] was being initialized prematurely, leading to the
  44. problem in make_request  (As long as blk_size[MAJOR] == 0, testing
  45. of sd_sizes is inhibited).
  46.  
  47. -Eric
  48.  
  49. *** sd.c.~1~    Tue Jul 28 19:31:23 1992
  50. --- sd.c    Wed Sep  9 17:18:37 1992
  51. ***************
  52. *** 38,44 ****
  53.                   
  54.   int NR_SD=0;
  55.   Scsi_Disk rscsi_disks[MAX_SD];
  56. ! static int sd_sizes[MAX_SD << 4];
  57.   static int this_count;
  58.   static int the_result;
  59.   
  60. --- 38,44 ----
  61.                   
  62.   int NR_SD=0;
  63.   Scsi_Disk rscsi_disks[MAX_SD];
  64. ! static int sd_sizes[MAX_SD << 4] = {0, };
  65.   static int this_count;
  66.   static int the_result;
  67.   
  68. ***************
  69. *** 56,64 ****
  70.   static void sd_geninit (void) {
  71.       int i;
  72.       for (i = 0; i < NR_SD; ++i)
  73. !         sd_sizes[i << 4] = 
  74. !         (sd[i << 4].nr_sects = rscsi_disks[i].capacity) >>
  75. !         (BLOCK_SIZE_BITS - 9);
  76.       sd_gendisk.nr_real = NR_SD;
  77.   }
  78.   
  79. --- 56,62 ----
  80.   static void sd_geninit (void) {
  81.       int i;
  82.       for (i = 0; i < NR_SD; ++i)
  83. !       sd[i << 4].nr_sects = rscsi_disks[i].capacity;
  84.       sd_gendisk.nr_real = NR_SD;
  85.   }
  86.   
  87. ***************
  88. *** 414,420 ****
  89.           }
  90.   
  91.       blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
  92. -     blk_size[MAJOR_NR] = sd_sizes;    
  93.       blkdev_fops[MAJOR_NR] = &sd_fops; 
  94.       sd_gendisk.next = gendisk_head;
  95.       gendisk_head = &sd_gendisk;
  96. --- 412,417 ----
  97. --
  98. Eric Youngdale
  99. eric@tantalus.nrl.navy.mil
  100.