Re: [Patch] Cleanup struct gendisk registration, 2.3.40-pre1

Guest section DW (dwguest@win.tue.nl)
Sat, 15 Jan 2000 04:55:46 +0100


On Thu, Jan 13, 2000 at 09:06:59PM -0500, Alexander Viro wrote:
>
> OK, could somebody explain where does IDE call ide_geninit() if built as
> module? And if it (apparently) doesn't, do we need it in built-in case?
> Andre, could you comment on that?

I am not Andre, and probably also late - vger stuff arrives here
with a delay of more than 24 hours. But let me see.

Various places check the device size before doing I/O.
For example, looking at a 2.3.39 source, ide.c:start_request() has
if (blockend > drive->part[minor].nr_sects) {
printk("%s: bad access\n", drive->name);
goto kill_rq;
}
So, it seems that before we can look at the partition table of
a device, we must know the size, or at least have a nonzero nr_sects,
otherwise bread will fail.

Now in check.c the routine setup_dev() does
dev->part[0].nr_sects = 0;
dev->init(dev);
resetup_one_dev(dev, drive);
and
dev->init(dev);
fills in the right value in nr_sects, needed by the
check_partition() called by resetup_one_dev().

So, just deleting the dev->init(dev); call here will fail, I think.
Note that scsi also has sd_geninit().

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/