pp->mediasize == 0 when reattaching physical medium ?

Rene Ladan r.c.ladan at gmail.com
Sun Jan 7 06:30:48 PST 2007


Rene Ladan schreef:
> Rene Ladan schreef:
>> Poul-Henning Kamp schreef:
>>> In message <45996C4F.8070700 at gmail.com>, Rene Ladan writes:
>>>> Hi,
>>>>
>>>> I've written an extension to /sys/geom/geom_mbr.c to slice up xbox360
>>>> hard disks and memory units.  The patch for revision 1.68 (i.e. CURRENT)
>>>> is at http://home.tisali.nl/rladan/freebsd/geom_mbr.c.diff
>>> This is wrong, you should make a geom_xbox360 class instead.
>>>
>> Ok, I made a geom_xbox360 class and restored geom_mbr.c
>>
>> The new class consists of three files at the above website.
>>
>> geom_xbox360.c : the class, put it in /sys/geom
>> geom_xbox360::Makefile : Makefile for /sys/modules/geom/geom_xbox360/
>> Makefile.diff : patch for /sys/modules/geom/Makefile
>>
>>
> I've uploaded a new version of geom_xbox360.c.  The class now works
> correctly except for:
> 
> 1) If you kldload the class and plug in a physical medium afterwards,
> then pp->mediasize == 0 so the taste function fails.  This does not
> happen if the medium is plugged in before the kldload or when using dd
> images using mdconfig.  I think that the taste function is called before
> the physical medium (here da0) is properly initialized.  MBR media don't
> suffer from this because mbr_taste() doesn't check pp->mediasize.  A
> dmesg is attached.
> 
I am able to reproduce this with a standard USB 1 memory stick.  The
medium is
correctly tasted when kldloading after the medium is plugged in, or when the
class is kldloaded and you finish making the stick look like an xbox360
medium.

I've uploaded a new version of the class, which enables experimenting
with a normal USB stick, as explained at lines 53-56.

I start to suspect that this is a bug in geom itself, should I send a PR ?

Regards,
Rene
-- 
GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6
(subkeys.pgp.net)

"It won't fit on the line."
		-- me, 2001



More information about the freebsd-geom mailing list