From owner-freebsd-geom@FreeBSD.ORG Sun Jan 7 14:30:48 2007 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EEB916A412 for ; Sun, 7 Jan 2007 14:30:48 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id CE88413C459 for ; Sun, 7 Jan 2007 14:30:47 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so5366682uge for ; Sun, 07 Jan 2007 06:30:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=JPZAyYCiFwjlGp6n+lv98OV5D260MhkAfqeyOvuy80czJ7f7BWgR/9Rl8bOexRPyCvvJz/0kz+Bz2WWn3uYCj5nHliVkpBkLNHtAiiPuFDDfO5b0JDCKIVdR7j5bgd/1OyzlAeaz10LEgres5hUeC/ypJx1k0TUzFbswYuIyf0o= Received: by 10.66.248.5 with SMTP id v5mr32131719ugh.1168180214772; Sun, 07 Jan 2007 06:30:14 -0800 (PST) Received: from ?192.168.123.201? ( [195.241.221.201]) by mx.google.com with ESMTP id k2sm31915985ugf.2007.01.07.06.30.13; Sun, 07 Jan 2007 06:30:14 -0800 (PST) Message-ID: <45A103F4.5040108@gmail.com> Date: Sun, 07 Jan 2007 15:30:12 +0100 From: Rene Ladan User-Agent: Thunderbird 1.5.0.9 (X11/20061224) MIME-Version: 1.0 To: freebsd-geom@freebsd.org References: <74225.1167686662@critter.freebsd.dk> <459D766B.9050304@gmail.com> <45A04444.8010701@gmail.com> In-Reply-To: <45A04444.8010701@gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Poul-Henning Kamp Subject: pp->mediasize == 0 when reattaching physical medium ? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 14:30:48 -0000 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