From owner-freebsd-current@FreeBSD.ORG Sat Oct 10 11:28:27 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25B7106566B for ; Sat, 10 Oct 2009 11:28:27 +0000 (UTC) (envelope-from johny-freebsd@earthmagic.org) Received: from ppp194-14.static.internode.on.net (ppp194-14.static.internode.on.net [59.167.194.14]) by mx1.freebsd.org (Postfix) with ESMTP id A4AA48FC1A for ; Sat, 10 Oct 2009 11:28:27 +0000 (UTC) Received: from [192.168.2.4] (tornado.zone2.earthmagic.org [192.168.2.4]) by ppp194-14.static.internode.on.net (Postfix-MSA) with ESMTP id 2F63566ECE for ; Sat, 10 Oct 2009 22:28:26 +1100 (EST) Message-ID: <4AD06FD9.20206@earthmagic.org> Date: Sat, 10 Oct 2009 22:28:25 +1100 From: Johny Mattsson User-Agent: Thunderbird 2.0.0.23 (X11/20090919) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: zfsboot insists on /boot.config being >=512 bytes to not be "invalid format" 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: Sat, 10 Oct 2009 11:28:28 -0000 Hi all, Just came across a tiny annoyance on 8.0-RC1-p1 - when booting off a zfs root and using a /boot.config file, zfsboot prints "Invalid format" unless /boot.config is at least 512 bytes. Everything still works, so this is a cosmetic/user-friendliness bug only. Looking at /sys/boot/i386/zfsboot/zfsboot.c, this appears to stem from xfsread() being used to load in /boot.config, and xfsread() wants to be able to read in a full buffer. Switching to using plain zfs_read() should fix it. Below is a one-liner patch to do so. Cheers, /Johny --- zfsboot.c.orig 2009-10-10 22:04:29.464823028 +1100 +++ zfsboot.c 2009-10-10 22:05:06.766834831 +1100 @@ -609,7 +609,7 @@ if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { off = 0; - xfsread(&dn, &off, cmd, sizeof(cmd)); + zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } if (*cmd) {