Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jan 2007 15:30:12 +0100
From:      Rene Ladan <r.c.ladan@gmail.com>
To:        freebsd-geom@freebsd.org
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Subject:   pp->mediasize == 0 when reattaching physical medium ?
Message-ID:  <45A103F4.5040108@gmail.com>
In-Reply-To: <45A04444.8010701@gmail.com>
References:  <74225.1167686662@critter.freebsd.dk> <459D766B.9050304@gmail.com> <45A04444.8010701@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Rene Ladan schreef:
> Rene Ladan schreef:
>> Poul-Henning Kamp schreef:
>>> In message <45996C4F.8070700@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45A103F4.5040108>