tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

buf->b_blkno v.s. buf->b_secno (Re: CVS commit: src/sys (moving to tech-kern))



Hi Andrew and Matthew,

On Wed, Jan 07, 2009 at 09:05:54PM +0000, Andrew Doran wrote:
> On Sun, Jan 04, 2009 at 06:33:50PM +1100, matthew green wrote:
> > !       /*
> > !        * XXX somehow memory is getting corrupted on 2048 byte sectors if 
> > its
> > !        * just 2 times 2048!! It even reads only 2048 bytes max in one go 
> > on
> > !        * optical media.
> > !        */
> > !
> > !       a.bp = geteblk(3 * (int)lp->d_secsize);

Found the critter... its the ancient `buf->b_blkno' needs to be in DEV_BSIZE.
disk_read_sectors() has as argument a sectornr and a count... but the
sectornr needs to be in DEV_BSIZE units and count needs to be in sectorsize
units (!!)

I could easily fixup the disk_read_sectors() call to make it do what it claims
to do: read a disk sector since its only used in 3 places.

Another bigger one would be to move buf->b_blkno to allways specify sectorsize
units. This would at least mean conversion of scsipi/cd scsipi/sd (if needed)
and the fixups in iso9660 and UDF to follow this.

Then we ought to rename buf->b_blkno to buf>b_secno :-D

With regards,
Reinoud



Home | Main Index | Thread Index | Old Index