From owner-freebsd-current@FreeBSD.ORG Mon Jul 16 15:40:35 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEDD0106564A; Mon, 16 Jul 2012 15:40:35 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 3655D8FC14; Mon, 16 Jul 2012 15:40:35 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q6GFeW5V010292; Mon, 16 Jul 2012 17:40:33 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q6GFeWpu010291; Mon, 16 Jul 2012 17:40:32 +0200 (CEST) (envelope-from marius) Date: Mon, 16 Jul 2012 17:40:32 +0200 From: Marius Strobl To: "Andrey V. Elsukov" Message-ID: <20120716154032.GA63893@alchemy.franken.de> References: <4FE9B01C.30306@yandex.ru> <5003EBAB.6030507@FreeBSD.org> <5003F39D.6030808@FreeBSD.org> <5003F589.40603@FreeBSD.org> <5003F79E.1060706@FreeBSD.org> <5003FB9D.90909@FreeBSD.org> <50040271.5000301@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50040271.5000301@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers , Marius Strobl , freebsd-current , Pawel Jakub Dawidek , Andriy Gapon Subject: Re: [CFC/CFT] large changes in the loader(8) code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 15:40:35 -0000 On Mon, Jul 16, 2012 at 04:00:49PM +0400, Andrey V. Elsukov wrote: > On 16.07.2012 15:31, Andriy Gapon wrote: > >> Yes. It should work as before. > > > > Well, but it's obvious that zfs_probe_dev would be attempting to do some unneeded > > stuff (trying to treat partitions as disks) for that case. To me this is a clear > > indication zfs_probe_dev is not optimal for arch-independent implementation. So I > > still think that arch_zfs_probe should decide what disks and partitions to probe, > > and zfs_probe_dev should only probe what it's given and not try to be any smarter. > > But I've repeated myself three times already :-) > > And we will have the same - several copies of the same code in each architecture, > which i have deleted... > > Sparc doesn't support DIOCGMEDIASIZE and DIOCGSECTORSIZE ioctls, > so it will not check each partition, only fd that is passed to the zfs_probe_dev. > > Currently there is only one problem with ZFS tasting, that can affect users - > now we taste each disk and partition, but in the my branch ZFS tastes only disks and > partitions with type "freebsd" and "freebsd-zfs". So if you have created ZFS on top > of MBR partition with type "ntfs", then loader will be unable to detect it. > Sorry, I'm missing the big picture of ZFS support in the loader and currently unfortunately don't have the time to look into it or your patches. I don't think there's a way to determine the media and sector sizes without actually looking at the Sun and/or VTOC8 labels though. As for zfs_probe_dev, some user recently indicated that on sparc64 we should rather look at the disk devices listed in the "boot-device" environment variable in order to mimic what Solaris does rather than trying to probe anything that might be a disk device, mimicking what the FreeBSD/i386 ZFS loader does. Maybe that's a hint whether a arch_zfs_probe should exist. I can test patches once you guys have figures out how things should work though. Marius