From owner-freebsd-scsi@FreeBSD.ORG Sun Nov 10 03:52:33 2013 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B928DD41 for ; Sun, 10 Nov 2013 03:52:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qe0-x233.google.com (mail-qe0-x233.google.com [IPv6:2607:f8b0:400d:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C07F241D for ; Sun, 10 Nov 2013 03:52:33 +0000 (UTC) Received: by mail-qe0-f51.google.com with SMTP id t7so251845qeb.24 for ; Sat, 09 Nov 2013 19:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:from:date:message-id:subject:to:content-type; bh=sI7uFgPDquWAFjD02twjVNDIMQr0HgAimT07GO0YRpk=; b=a6IFQp9o6CHzOTgLWRTZ2Qq5LIBtqbO2zkGkdUHNeI7PuwerS0aS52DpjMuN+ic10H 9m4igOhvke9TFEFRgU7WUW95doB84AJnE/9+hu81IVJYqxfsGeYgJg9mYLua3DyhLUbO Ye9Ef0mn3mnRYfLXLH4alqfFamhoi8F6b5kKk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=sI7uFgPDquWAFjD02twjVNDIMQr0HgAimT07GO0YRpk=; b=kpNICm/XpsU6nJ6bcCmA4/6yGXLbLpQ/O35W8ipW7NC/B6g9mn8vS2jFVIQpTKzDZw mscYMjwEYtQ9pdrEZVncIxKWcl58cyMBagsn2SdrueG6L3P4qHfs7V3f4nBu4ikqVJpX fSguB9ugjC65MK2406hw7CG0Kpe2qoM3aX8mjd5Yxco1ZjFlFHyzqX/gHF7kJpFl2x/p ktesoNjkkEWYxjysYuGG+anKhQfN/bklibE9aN+UQV2C4eBf2zrT/qDLL6U9/bpxG66U 2alMXiYLNPTSm2Iwgi8kDvvzGokShMYv7vW8MYhbUlocIQ+GNoPD756Y1oOHMFKj2QYu /KXg== X-Gm-Message-State: ALoCoQlBeXlPXkqGMoupjjDFRbYJvlzglFcAOOukEDdzQ2wgjzksqFfmH8+USR0PMcDCY1xiqAUx X-Received: by 10.224.69.132 with SMTP id z4mr37110179qai.78.1384055552692; Sat, 09 Nov 2013 19:52:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.101 with HTTP; Sat, 9 Nov 2013 19:52:02 -0800 (PST) From: Eitan Adler Date: Sat, 9 Nov 2013 22:52:02 -0500 Message-ID: Subject: mptutil, mfitil, expand_number To: scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Nov 2013 03:52:33 -0000 Any thoughts? commit 20ad9d0a2bd9aea4aaf7c5ae925397 8ae0aed75c Author: Eitan Adler Date: Sat Nov 9 22:19:41 2013 -0500 Indicate that expand_number is case-insensitive. diff --git a/lib/libutil/expand_number.3 b/lib/libutil/expand_number.3 index f78223b..2f5871f 100644 --- a/lib/libutil/expand_number.3 +++ b/lib/libutil/expand_number.3 @@ -51,12 +51,13 @@ argument. The .Fn expand_number function +is case-insensitive and follows the SI power of two convention. .Pp The prefixes are: .Bl -column "Prefix" "Description" "1000000000000000000" -offset indent .It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" -.It Li k Ta No kilo Ta 1024 +.It Li K Ta No kilo Ta 1024 .It Li M Ta No mega Ta 1048576 .It Li G Ta No giga Ta 1073741824 .It Li T Ta No tera Ta 1099511627776 commit e5d0f01bcea9115bd27394ae27a295717597cf7b Author: Eitan Adler Date: Sat Nov 9 22:09:17 2013 -0500 Convert from a hand-rolled function to expand_number. diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c index 17b9945..ae66258 100644 --- a/usr.sbin/mptutil/mpt_config.c +++ b/usr.sbin/mptutil/mpt_config.c @@ -43,6 +43,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include "mptutil.h" @@ -50,35 +51,6 @@ __RCSID("$FreeBSD$"); static void dump_config(CONFIG_PAGE_RAID_VOL_0 *vol); #endif -static long -dehumanize(const char *value) -{ - char *vtp; - long iv; - - if (value == NULL) - return (0); - iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { - return (0); - } - switch (vtp[0]) { - case 't': case 'T': - iv *= 1024; - case 'g': case 'G': - iv *= 1024; - case 'm': case 'M': - iv *= 1024; - case 'k': case 'K': - iv *= 1024; - case '\0': - break; - default: - return (0); - } - return (iv); -} - /* * Lock the volume by opening its /dev device read/write. This will * only work if nothing else has it opened (including mounts). We @@ -666,7 +638,9 @@ create_volume(int ac, char **av) quick = 1; break; case 's': - stripe_size = dehumanize(optarg); + error = expand_number(optarg, &stripe_size); + if (error == -1) + errx(EX_USAGE, "%s: stripe size incorrect", optarg); if ((stripe_size < 512) || (!powerof2(stripe_size))) { warnx("Invalid stripe size %s", optarg); return (EINVAL); commit 903b59a53bf479a5aa68ea523e5d0c1a2da7a8d9 Author: Eitan Adler Date: Sat Nov 9 22:09:17 2013 -0500 Convert from a hand-rolled function to expand_number. Reviewed by: sbruno diff --git a/usr.sbin/mfiutil/mfi_config.c b/usr.sbin/mfiutil/mfi_config.c index a919214..9f64cbc 100644 --- a/usr.sbin/mfiutil/mfi_config.c +++ b/usr.sbin/mfiutil/mfi_config.c @@ -41,41 +41,13 @@ #include #include #include +#include #include #include "mfiutil.h" static int add_spare(int ac, char **av); static int remove_spare(int ac, char **av); -static long -dehumanize(const char *value) -{ - char *vtp; - long iv; - - if (value == NULL) - return (0); - iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { - return (0); - } - switch (vtp[0]) { - case 't': case 'T': - iv *= 1024; - case 'g': case 'G': - iv *= 1024; - case 'm': case 'M': - iv *= 1024; - case 'k': case 'K': - iv *= 1024; - case '\0': - break; - default: - return (0); - } - return (iv); -} - int mfi_config_read(int fd, struct mfi_config_data **configp) { @@ -629,7 +601,9 @@ create_volume(int ac, char **av) break; #endif case 's': - stripe_size = dehumanize(optarg); + error = expand_number(optarg, &stripe_size); + if (error == -1) + errx(EX_USAGE, "%s: stripe size incorrect", optarg); if ((stripe_size < 512) || (!powerof2(stripe_size))) stripe_size = 64 * 1024; break; -- Eitan Adler From owner-freebsd-scsi@FreeBSD.ORG Sun Nov 10 06:25:41 2013 Return-Path: Delivered-To: scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB0E7F34 for ; Sun, 10 Nov 2013 06:25:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 610DE28E1 for ; Sun, 10 Nov 2013 06:25:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 4EE261AA268; Sun, 10 Nov 2013 17:25:26 +1100 (EST) Date: Sun, 10 Nov 2013 17:25:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: mptutil, mfitil, expand_number In-Reply-To: Message-ID: <20131110161359.S1474@besplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=WvzHK2nvTcUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=oiRXuiCKKlcA:10 a=eR1LQOD-GpsQidJ1S0gA:9 a=XtSjqWxeeNbtF_oK:21 a=REZHW0Y7hR6k14Dp:21 a=CjuIK1q_8ugA:10 Cc: scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Nov 2013 06:25:41 -0000 On Sat, 9 Nov 2013, Eitan Adler wrote: > Any thoughts? > diff --git a/lib/libutil/expand_number.3 b/lib/libutil/expand_number.3 > index f78223b..2f5871f 100644 > --- a/lib/libutil/expand_number.3 > +++ b/lib/libutil/expand_number.3 > @@ -51,12 +51,13 @@ argument. > The > .Fn expand_number > function > +is case-insensitive and > follows the SI power of two convention. > .Pp > The prefixes are: > .Bl -column "Prefix" "Description" "1000000000000000000" -offset indent > .It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" > -.It Li k Ta No kilo Ta 1024 > +.It Li K Ta No kilo Ta 1024 > .It Li M Ta No mega Ta 1048576 > .It Li G Ta No giga Ta 1073741824 > .It Li T Ta No tera Ta 1099511627776 This is consistent with bugs in what the function actually does. The prefixes should have been case-insensitive. M should mean mega and m milli. It is hard to distinguish M meaning 1000**2 from M meaning 1024**2, but no one needs m meaning 1/1024 and this API can't represent 1/1024 (another design bug in the API is that it doesn't support floating point). k should mean 1000, and K should be available for 1024. I should blacklist anything that uses kibi or mebi. Even this API doesn't support them. > diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c > index 17b9945..ae66258 100644 > --- a/usr.sbin/mptutil/mpt_config.c > +++ b/usr.sbin/mptutil/mpt_config.c > @@ -43,6 +43,7 @@ __RCSID("$FreeBSD$"); > #include > #include > #include > +#include Using this is a style bug. > #include > #include "mptutil.h" > > @@ -50,35 +51,6 @@ __RCSID("$FreeBSD$"); > static void dump_config(CONFIG_PAGE_RAID_VOL_0 *vol); > #endif > > -static long > -dehumanize(const char *value) > -{ > - char *vtp; > - long iv; > - > - if (value == NULL) > - return (0); > - iv = strtoq(value, &vtp, 0); > - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { > - return (0); > - } Using expand_number() gives different overflow bugs. Here there was the usual null range checking for assiging quad_t to long. There were more overflow bugs in the rest of the function. expand_number() is better, but... > /* > * Lock the volume by opening its /dev device read/write. This will > * only work if nothing else has it opened (including mounts). We > @@ -666,7 +638,9 @@ create_volume(int ac, char **av) > quick = 1; > break; > case 's': > - stripe_size = dehumanize(optarg); > + error = expand_number(optarg, &stripe_size); ... stripe_size still has type long, so more than overflow occurs when the range-checked uint64_t result of expand_number() is assigned to a 32-bit long. The behaviour from the buffer overrun is undefined. This fatal type mismatch should be detected at compile time on 32-bit arches. The not-so-fatal type mismatch of assigning an (unsigned) uint64_t to a (signed) 64-bit long will probably not be detected at compile time. This gives some overflow bugs. > + if (error == -1) > + errx(EX_USAGE, "%s: stripe size incorrect", optarg); > if ((stripe_size < 512) || (!powerof2(stripe_size))) { > warnx("Invalid stripe size %s", optarg); > return (EINVAL); Something mangled this part of the diff. The error handling is insistent. The old code only warns and returns EINVAL on error. This function seems to never handle errors by exiting, and that is a good design. Something should check that the stripe size is not too large. dehumanize() only limited it to LONG_MAX (modulo overflow bugs) and expand_number() only limits it to UINT64_MAX (module overflow and other bugs). These values aren't powers of 2, so the upper limit is just slightly smaller than them. Using sysexits.h is not just a style bug. It predjudices the (hopefully better) error handling done in the caller (mptutil doesn't use sysexits anywhere else), and loses the (hopefully more descriptive) errno returned by expand_number(). expand_number() will return EINVAL on error (in errno) in most cases too. It is correct to use warnx() or errx() so as to not print "Invalid" twice. It would be useful to print something different when expand_number() returns ERANGE, but this is not so easy. Returning ERANGE instead of EINVAL for this case is easy. strtonum(3) has a different set of design errors and complications related to all of this. It does range checking that we want, but we can't use it since it doesn't support scientific notation. It generates strings describing the range errors but these are hard to use; actually using its complications makes it almost as hard to use as not using it. Bruce From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 11 02:16:42 2013 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76AD07E5 for ; Mon, 11 Nov 2013 02:16:42 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qe0-x235.google.com (mail-qe0-x235.google.com [IPv6:2607:f8b0:400d:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33DCB218C for ; Mon, 11 Nov 2013 02:16:42 +0000 (UTC) Received: by mail-qe0-f53.google.com with SMTP id cy11so3892860qeb.40 for ; Sun, 10 Nov 2013 18:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3Lza0SUORtbC+LPRffo3yaq32awtIbIu0/saWCSwsAc=; b=gI0H1ymhl+Yu0l+9soKPe3C4/cU8UtysdLyVxraaUfmEUIPtsk0xWpxXkBczZsrjzf Aepito6Qj30+VG2AV1C4MUcTkEgsuCKu3ciX0RgrctFsPK3jYekuO1JMWABZ6sogob+y DXDhkYg5bMRbnMwpT0WAFGiVBb7pi6d2nKmj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=3Lza0SUORtbC+LPRffo3yaq32awtIbIu0/saWCSwsAc=; b=BIJCulHaf6VEj6ksZ6VSwaZNbkiLBEcuKaxxf3fzfBuV0GiAn/zFW3OOj7ymrYo/q+ zIkqblkL/xe+PZlROqF1pgK0Z82n2cObQMUHnHfkt6xUO0EbDTfbOoOISwJ2pFaG0Zm0 JVy0YgFZz+7qyjmrdGi9LiMCgCEVAwXohTeMqYglUVJ5KA8Qf1afdvV7rF84ZZz4baRD DhxnuIMiZCbq/pQqbruP9qhpUEmoABudIDBIDKtWnddtLcV/NZK5FghvJfZYV1p1jqKC z3068SCKPuiW6/HZIpCXyp9vuEbY9gOAayBPwNRU+HJJZif6d9gZmdeu2fPfesps+kLK vL1A== X-Gm-Message-State: ALoCoQnKgZIr4rXJLDSd+tPPXd3vh4nRs6AYaSmVy17j7uxiP22POwpdVBSIprJNk4MRpxvR1Eq8 X-Received: by 10.224.69.132 with SMTP id z4mr45024607qai.78.1384136201437; Sun, 10 Nov 2013 18:16:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.101 with HTTP; Sun, 10 Nov 2013 18:16:11 -0800 (PST) In-Reply-To: <20131110161359.S1474@besplex.bde.org> References: <20131110161359.S1474@besplex.bde.org> From: Eitan Adler Date: Sun, 10 Nov 2013 21:16:11 -0500 Message-ID: Subject: Re: mptutil, mfitil, expand_number To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 02:16:42 -0000 On Sun, Nov 10, 2013 at 1:25 AM, Bruce Evans wrote: > On Sat, 9 Nov 2013, Eitan Adler wrote: Lets see if I understand everything you wanted me to do. I am not intending to fix any bugs in expand_number at the moment if any. In case the patch below is mangled the following should be identical: http://people.freebsd.org/~eadler/files/expand_number.diff commit 55c7ba2c76c9719617f0e76cb781fad0e26eba74 Author: Eitan Adler Date: Sat Nov 9 22:09:17 2013 -0500 Convert from a hand-rolled function to expand_number. diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c index 17b9945..0d34d16 100644 --- a/usr.sbin/mptutil/mpt_config.c +++ b/usr.sbin/mptutil/mpt_config.c @@ -50,35 +50,6 @@ __RCSID("$FreeBSD$"); static void dump_config(CONFIG_PAGE_RAID_VOL_0 *vol); #endif -static long -dehumanize(const char *value) -{ - char *vtp; - long iv; - - if (value == NULL) - return (0); - iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { - return (0); - } - switch (vtp[0]) { - case 't': case 'T': - iv *= 1024; - case 'g': case 'G': - iv *= 1024; - case 'm': case 'M': - iv *= 1024; - case 'k': case 'K': - iv *= 1024; - case '\0': - break; - default: - return (0); - } - return (iv); -} - /* * Lock the volume by opening its /dev device read/write. This will * only work if nothing else has it opened (including mounts). We @@ -615,7 +586,7 @@ create_volume(int ac, char **av) CONFIG_PAGE_RAID_VOL_0 *vol; struct config_id_state state; struct volume_info *info; - long stripe_size; + uint64_t stripe_size; int ch, error, fd, i, quick, raid_type, verbose; #ifdef DEBUG int dump; @@ -666,7 +637,11 @@ create_volume(int ac, char **av) quick = 1; break; case 's': - stripe_size = dehumanize(optarg); + error = expand_number(optarg, &stripe_size); + if (error == -1) { + warnx("Invalid stripe size %s", optarg); + return (errno); + } if ((stripe_size < 512) || (!powerof2(stripe_size))) { warnx("Invalid stripe size %s", optarg); return (EINVAL); commit fdca0b483f9184f0a6de420086a81cfa34652a5f Author: Eitan Adler Date: Sat Nov 9 22:09:17 2013 -0500 Convert from a hand-rolled function to expand_number. Reviewed by: sbruno diff --git a/usr.sbin/mfiutil/mfi_config.c b/usr.sbin/mfiutil/mfi_config.c index a919214..abecb7d 100644 --- a/usr.sbin/mfiutil/mfi_config.c +++ b/usr.sbin/mfiutil/mfi_config.c @@ -47,35 +47,6 @@ static int add_spare(int ac, char **av); static int remove_spare(int ac, char **av); -static long -dehumanize(const char *value) -{ - char *vtp; - long iv; - - if (value == NULL) - return (0); - iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { - return (0); - } - switch (vtp[0]) { - case 't': case 'T': - iv *= 1024; - case 'g': case 'G': - iv *= 1024; - case 'm': case 'M': - iv *= 1024; - case 'k': case 'K': - iv *= 1024; - case '\0': - break; - default: - return (0); - } - return (iv); -} - int mfi_config_read(int fd, struct mfi_config_data **configp) { @@ -629,7 +600,11 @@ create_volume(int ac, char **av) break; #endif case 's': - stripe_size = dehumanize(optarg); + error = expand_number(optarg, &stripe_size); + if (error == -1) { + error = errno; + goto error; + } if ((stripe_size < 512) || (!powerof2(stripe_size))) stripe_size = 64 * 1024; break; commit 20ad9d0a2bd9aea4aaf7c5ae9253978ae0aed75c Author: Eitan Adler Date: Sat Nov 9 22:19:41 2013 -0500 Indicate that expand_number is case-insensitive. diff --git a/lib/libutil/expand_number.3 b/lib/libutil/expand_number.3 index f78223b..2f5871f 100644 --- a/lib/libutil/expand_number.3 +++ b/lib/libutil/expand_number.3 @@ -51,12 +51,13 @@ argument. The .Fn expand_number function +is case-insensitive and follows the SI power of two convention. .Pp The prefixes are: .Bl -column "Prefix" "Description" "1000000000000000000" -offset indent .It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" -.It Li k Ta No kilo Ta 1024 +.It Li K Ta No kilo Ta 1024 .It Li M Ta No mega Ta 1048576 .It Li G Ta No giga Ta 1073741824 .It Li T Ta No tera Ta 1099511627776 -- Eitan Adler From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 11 04:21:42 2013 Return-Path: Delivered-To: scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C613E81 for ; Mon, 11 Nov 2013 04:21:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id B9BCC2709 for ; Mon, 11 Nov 2013 04:21:41 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 8AE243CDA1C; Mon, 11 Nov 2013 14:14:45 +1100 (EST) Date: Mon, 11 Nov 2013 14:14:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: mptutil, mfitil, expand_number In-Reply-To: Message-ID: <20131111134424.N854@besplex.bde.org> References: <20131110161359.S1474@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=WvzHK2nvTcUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=oiRXuiCKKlcA:10 a=wr-8jAivI19nOVbf5igA:9 a=8xKpZ07xwyGC5BvV:21 a=ygRQkgweRc6PhHQw:21 a=CjuIK1q_8ugA:10 Cc: scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 04:21:42 -0000 On Sun, 10 Nov 2013, Eitan Adler wrote: > On Sun, Nov 10, 2013 at 1:25 AM, Bruce Evans wrote: > Lets see if I understand everything you wanted me to do. I am not > intending to fix any bugs in expand_number at the moment if any. > diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c > index 17b9945..0d34d16 100644 > --- a/usr.sbin/mptutil/mpt_config.c > +++ b/usr.sbin/mptutil/mpt_config.c > ... > @@ -615,7 +586,7 @@ create_volume(int ac, char **av) > CONFIG_PAGE_RAID_VOL_0 *vol; > struct config_id_state state; > struct volume_info *info; > - long stripe_size; > + uint64_t stripe_size; > int ch, error, fd, i, quick, raid_type, verbose; > #ifdef DEBUG > int dump; Blindly changing the type is not clearly safe. In fact, it is not safe. After initialization, it is only used to pass to functions expecting a long, and there is a prototype that blindly converts it to long. Overflow can then occur on 32-bit systems, since you didn't fix the range checking. > @@ -666,7 +637,11 @@ create_volume(int ac, char **av) > quick = 1; > break; > case 's': > - stripe_size = dehumanize(optarg); > + error = expand_number(optarg, &stripe_size); > + if (error == -1) { > + warnx("Invalid stripe size %s", optarg); > + return (errno); > + } > if ((stripe_size < 512) || (!powerof2(stripe_size))) { > warnx("Invalid stripe size %s", optarg); > return (EINVAL); Overflow occurs when stripe_size is used when it exceeds > LONG_MAX. This can give a negative number. E.g., on 32-bit 2's complement systems, stripe_size might be 0x80000000 here. This gets converted to LONG_MIN. Dividing this by 512 gives -4194304 in vol->StripeSize. The previous overflow bugs could never give a negative value, since if dehumanize() overflows to a negative value then in the above it doesn't pass the !(stripe_size < 512) test. Larger values can overflow to anything. This should be fixed by checking the range from above like I said before. I forgot to check before if powerof2() works. It was invalid to call it with a long arg, and the type change fixes this. powerof2() and nearby functions in require an unsigned type, or a strictly positive (nonzero) signed value, or pure 2's complement. A range check from above would have fixed this too. Of course, systemish code like this assumes pure 2's complement for everthing. Bruce From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 11 11:06:56 2013 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7AEB29AE for ; Mon, 11 Nov 2013 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 689632CCC for ; Mon, 11 Nov 2013 11:06:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rABB6uIr082220 for ; Mon, 11 Nov 2013 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rABB6tjc082211 for freebsd-scsi@FreeBSD.org; Mon, 11 Nov 2013 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 11 Nov 2013 11:06:55 GMT Message-Id: <201311111106.rABB6tjc082211@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-scsi@FreeBSD.org Subject: Current problem reports assigned to freebsd-scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 11:06:56 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/179932 scsi [ciss] ciss i/o stall problem with HP Bl Gen8 (and HP o kern/178795 scsi [mps] MSI for mps driver doesn't work under vmware o kern/165982 scsi [mpt] mpt instability, drive resets, and losses on Fre o kern/165740 scsi [cam] SCSI code must drain callbacks before free f kern/162256 scsi [mpt] QUEUE FULL EVENT and 'mpt_cam_event: 0x0' o docs/151336 scsi Missing documentation of scsi_ and ata_ functions in c o kern/148083 scsi [aac] Strange device reporting o kern/144648 scsi [aac] Strange values of speed and bus width in dmesg o kern/142351 scsi [mpt] LSILogic driver performance problems o kern/134488 scsi [mpt] MPT SCSI driver probes max. 8 LUNs per device o kern/130621 scsi [mpt] tranfer rate is inscrutable slow when use lsi213 f kern/129602 scsi [ahd] ahd(4) gets confused and wedges SCSI bus f kern/123674 scsi [ahc] ahc driver dumping o sparc/121676 scsi [iscsi] iscontrol do not connect iscsi-target on sparc 14 problems total. From owner-freebsd-scsi@FreeBSD.ORG Thu Nov 14 19:25:24 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9739D13E; Thu, 14 Nov 2013 19:25:24 +0000 (UTC) Received: from thebighonker.lerctr.org (lrosenman-1-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:3ad::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66623272E; Thu, 14 Nov 2013 19:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=b2UO/t0KAYouhsPU/+C7Et4EIrqU/2UwfevP6+iZPTA=; b=sjAexJBbL0YDRzKsC1Q0EEPIWbLLLCwUQZ6BJzGNWyr5iZ5s2DnWuDjUAoDIxrm/Vp4zejqYYxDT//SzKMzjzJQfBvEXnQCXTAkt+YrAkUo/KfMjKh3Zl9kMBwZIwPcXUgyPy51TEPo/sOH1qkMIr6cwgtOxk141txuMBTZfS78=; Received: from lrosenman-1-pt.tunnel.tserv8.dal1.ipv6.he.net ([2001:470:1f0e:3ad::2]:31796 helo=thebighonker.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Vh2XV-0006is-JV; Thu, 14 Nov 2013 13:25:21 -0600 Date: Thu, 14 Nov 2013 13:25:16 -0600 From: Larry Rosenman To: freebsd-scsi@freebsd.org, freebsd-stable@freebsd.org Subject: [ler@lerctr.org: 10-BETA3: Bad negotiation on AHD controller] Message-ID: <20131114192516.GA25786@thebighonker.lerctr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Score: -2.9 (--) X-LERCTR-Spam-Score: -2.9 (--) X-Spam-Report: SpamScore (-2.9/5.0) ALL_TRUSTED=-1,BAYES_00=-1.9 X-LERCTR-Spam-Report: SpamScore (-2.9/5.0) ALL_TRUSTED=-1,BAYES_00=-1.9 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2013 19:25:24 -0000 Can anyone help me here? ----- Forwarded message from Larry Rosenman ----- Date: Sat, 9 Nov 2013 08:46:26 -0600 =46rom: Larry Rosenman To: freebsd-stable@freebsd.org Subject: 10-BETA3: Bad negotiation on AHD controller User-Agent: Mutt/1.5.22 (2013-10-16) Ever since I put 10 on this box (source upgrade from 8), I've been getting slow disk negotiations on 2 of my 4 disks, and weird messages at boot from= =20 the ahd controller. Can someone tell if it's my disk or the code? # for i in 0 1 2 3 > do > camcontrol inquiry 0:${i}:0 > done pass0: Fixed Direct Access SCSI-3 device pass0: Serial Number DAA0P7A054GD pass0: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Command Queue= ing Enabled pass1: Fixed Direct Access SCSI-3 device pass1: Serial Number DAA0P7A054G3 pass1: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Command Queue= ing Enabled pass2: Fixed Direct Access SCSI-3 device pass2: Serial Number 3KS2NFJG00007611CFPX pass2: 3.300MB/s transfers, Command Queueing Enabled pass3: Fixed Direct Access SCSI-3 device pass3: Serial Number 3KS1Z2KF00007620X9K1 pass3: 3.300MB/s transfers, Command Queueing Enabled # dmesg.boot: Copyright (c) 1992-2013 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-BETA3 #3 r257864: Fri Nov 8 15:20:07 CST 2013 root@thebighonker.lerctr.org:/usr/obj/usr/src/sys/THEBIGHONKER amd64 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 CPU: Intel(R) Xeon(TM) CPU 3.00GHz (2992.56-MHz K8-class CPU) Origin =3D "GenuineIntel" Id =3D 0xf43 Family =3D 0xf Model =3D 0x4 S= tepping =3D 3 Features=3D0xbfebfbff Features2=3D0x641d AMD Features=3D0x20100800 TSC: P-state invariant real memory =3D 9395240960 (8960 MB) avail memory =3D 8282472448 (7898 MB) Event timer "LAPIC" quality 400 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 2 package(s) x 1 core(s) x 2 HTT threads cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 cpu2 (AP): APIC ID: 6 cpu3 (AP/HT): APIC ID: 7 ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-47 on motherboard ioapic2 irqs 48-71 on motherboard random: initialized kbd1 at kbdmux0 acpi0: on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on = acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 450 Event timer "HPET1" frequency 14318180 Hz quality 440 Event timer "HPET2" frequency 14318180 Hz quality 440 atrtc0: port 0x70-0x77 on acpi0 Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 0.1 (no driver attached) pci0: at device 1.0 (no driver attached) pcib1: irq 16 at device 2.0 on pci0 pci1: on pcib1 pcib2: at device 0.0 on pci1 pci2: on pcib2 ahd0: port 0x2400-0x24ff,0x2000-0x2= 0ff mem 0xdd200000-0xdd201fff irq 32 at device 2.0 on pci2 aic7902: Ultra320 Wide Channel A, SCSI Id=3D7, PCI-X 101-133MHz, 512 SCBs ahd1: port 0x2c00-0x2cff,0x2800-0x2= 8ff mem 0xdd202000-0xdd203fff irq 33 at device 2.1 on pci2 aic7902: Ultra320 Wide Channel B, SCSI Id=3D7, PCI-X 101-133MHz, 512 SCBs pcib3: at device 0.2 on pci1 pci3: on pcib3 em0: port 0x3000-0x303f= mem 0xdd300000-0xdd31ffff irq 54 at device 2.0 on pci3 em0: Ethernet address: 00:30:48:2e:99:ba em1: port 0x3040-0x307f= mem 0xdd320000-0xdd33ffff irq 55 at device 2.1 on pci3 em1: Ethernet address: 00:30:48:2e:99:bb pcib4: irq 16 at device 4.0 on pci0 pci4: on pcib4 pcib5: irq 16 at device 6.0 on pci0 pci5: on pcib5 uhci0: port 0x1400-0x141f irq 1= 6 at device 29.0 on pci0 usbus0 on uhci0 uhci1: port 0x1420-0x143f irq 1= 9 at device 29.1 on pci0 usbus1 on uhci1 uhci2: port 0x1440-0x145f irq 1= 8 at device 29.2 on pci0 usbus2 on uhci2 uhci3: port 0x1460-0x147f irq 1= 6 at device 29.3 on pci0 usbus3 on uhci3 ehci0: mem 0xdd001000-0xdd0013f= f irq 23 at device 29.7 on pci0 usbus4: EHCI version 1.0 usbus4 on ehci0 pcib6: at device 30.0 on pci0 pci6: on pcib6 vgapci0: port 0x4000-0x40ff mem 0xde000000-0xdefff= fff,0xdd400000-0xdd400fff irq 17 at device 1.0 on pci6 drm0: on vgapci0 info: [drm] Initialized mach64 2.0.0 20060718 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177= ,0x376,0x14a0-0x14af at device 31.1 on pci0 ata0: at channel 0 on atapci0 ata1: at channel 1 on atapci0 ichsmb0: port 0x1100-0x111f irq 17 = at device 31.3 on pci0 smbus0: on ichsmb0 smb0: on smbus0 acpi_button0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0 fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fd0: <1440-KB 3.5" drive> on fdc0 drive 0 orm0: at iomem 0xc0000-0xc7fff,0xc8000-0xc8fff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ppc0: cannot reserve I/O port range p4tcc0: on cpu0 p4tcc1: on cpu1 p4tcc2: on cpu2 p4tcc3: on cpu3 ZFS filesystem version: 5 ZFS storage pool version: features support (5000) Timecounters tick every 1.000 msec random: unblocking device. usbus0: 12Mbps Full Speed USB v1.0 usbus1: 12Mbps Full Speed USB v1.0 usbus2: 12Mbps Full Speed USB v1.0 usbus3: 12Mbps Full Speed USB v1.0 usbus4: 480Mbps High Speed USB v2.0 ugen1.1: at usbus1 uhub0: on usbus1 ugen0.1: at usbus0 uhub1: on usbus0 ugen3.1: at usbus3 uhub2: on usbus3 ugen2.1: at usbus2 uhub3: on usbus2 ugen4.1: at usbus4 uhub4: on usbus4 uhub0: 2 ports with 2 removable, self powered uhub1: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered uhub3: 2 ports with 2 removable, self powered uhub4: 8 ports with 8 removable, self powered ahd0: Invalid Sequencer interrupt occurred. >>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<< ahd0: Dumping Card State at program address 0x23c Mode 0x0 Card was paused INTSTAT[0x0] SELOID[0x2] SELID[0x30] HS_MAILBOX[0x0]=20 INTCTL[0x80]:(SWTMINTMASK) SEQINTSTAT[0x0] SAVED_MODE[0x11]=20 DFFSTAT[0x33]:(CURRFIFO_NONE|FIFO0FREE|FIFO1FREE)=20 SCSISIGI[0x0]:(P_DATAOUT) SCSIPHASE[0x0] SCSIBUS[0x0]=20 LASTPHASE[0x1]:(P_DATAOUT|P_BUSFREE) SCSISEQ0[0x0]=20 SCSISEQ1[0x12]:(ENAUTOATNP|ENRSELI) SEQCTL0[0x0] SEQINTCTL[0x6]:(INTMASK1|I= NTMASK2)=20 SEQ_FLAGS[0x0] SEQ_FLAGS2[0x0] QFREEZE_COUNT[0x5]=20 KERNEL_QFREEZE_COUNT[0x5] MK_MESSAGE_SCB[0xff00] MK_MESSAGE_SCSIID[0xff]=20 SSTAT0[0x0] SSTAT1[0x8]:(BUSFREE) SSTAT2[0x0] SSTAT3[0x0]=20 PERRDIAG[0x0] SIMODE1[0xa4]:(ENSCSIPERR|ENSCSIRST|ENSELTIMO)=20 LQISTAT0[0x0] LQISTAT1[0x0] LQISTAT2[0x0] LQOSTAT0[0x0]=20 LQOSTAT1[0x0] LQOSTAT2[0x0]=20 SCB Count =3D 512 CMDS_PENDING =3D 0 LASTSCB 0xffff CURRSCB 0x1fb NEXTSCB 0= xff40 qinstart =3D 59 qinfifonext =3D 61 QINFIFO: 0x1fa 0x1f9 WAITING_TID_QUEUES: Pending list: 505 FIFO_USE[0x0] SCB_CONTROL[0x48]:(STATUS_RCVD|DISCENB) SCB_SCSIID[0x7]= =20 506 FIFO_USE[0x0] SCB_CONTROL[0x48]:(STATUS_RCVD|DISCENB) SCB_SCSIID[0x17]= =20 Total 2 Kernel Free SCB lists:=20 Any Device: 497 507 500 498 499 501 502 503 504 508 509 510 511 496 495 4= 94 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 = 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457= 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 43= 8 437 436 435 434 433 432 431 430 429 428 427 426 425 424 423 422 421 420 4= 19 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 = 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382= 381 380 379 378 377 376 375 374 373 372 371 370 369 368 367 366 365 364 36= 3 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 3= 44 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 = 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307= 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 28= 8 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 2= 69 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 = 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232= 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 21= 3 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 1= 94 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 = 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157= 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 13= 8 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 1= 19 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 = 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76= 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51= 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26= 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0=20 Sequencer Complete DMA-inprog list:=20 Sequencer Complete list:=20 Sequencer DMA-Up and Complete list:=20 Sequencer On QFreeze and Complete list:=20 ahd0: FIFO0 Free, LONGJMP =3D=3D 0x8000, SCB 0x1f1 SEQIMODE[0x3f]:(ENCFG4TCMD|ENCFG4ICMD|ENCFG4TSTAT|ENCFG4ISTAT|ENCFG4DATA|EN= SAVEPTRS)=20 SEQINTSRC[0x0] DFCNTRL[0x0] DFSTATUS[0x89]:(FIFOEMP|HDONE|PRELOAD_AVAIL)=20 SG_CACHE_SHADOW[0x2]:(LAST_SEG) SG_STATE[0x0] DFFSXFRCTL[0x0]=20 SOFFCNT[0x0] MDFFSTAT[0x5]:(FIFOFREE|DLZERO) SHADDR =3D 0x00, SHCNT =3D 0x0= =20 HADDR =3D 0x00, HCNT =3D 0x0 CCSGCTL[0x10]:(SG_CACHE_AVAIL)=20 ahd0: FIFO1 Free, LONGJMP =3D=3D 0x8063, SCB 0x1fb SEQIMODE[0x3f]:(ENCFG4TCMD|ENCFG4ICMD|ENCFG4TSTAT|ENCFG4ISTAT|ENCFG4DATA|EN= SAVEPTRS)=20 SEQINTSRC[0x0] DFCNTRL[0x0] DFSTATUS[0x89]:(FIFOEMP|HDONE|PRELOAD_AVAIL)=20 SG_CACHE_SHADOW[0x2]:(LAST_SEG) SG_STATE[0x0] DFFSXFRCTL[0x0]=20 SOFFCNT[0x0] MDFFSTAT[0x5]:(FIFOFREE|DLZERO) SHADDR =3D 0x00, SHCNT =3D 0x0= =20 HADDR =3D 0x00, HCNT =3D 0x0 CCSGCTL[0x10]:(SG_CACHE_AVAIL)=20 LQIN: 0x8 0x0 0x1 0xf1 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 = 0x0 0x0 0x0=20 ahd0: LQISTATE =3D 0x0, LQOSTATE =3D 0x0, OPTIONMODE =3D 0x42 ahd0: OS_SPACE_CNT =3D 0x20 MAXCMDCNT =3D 0x1 ahd0: SAVED_SCSIID =3D 0x0 SAVED_LUN =3D 0x0 SIMODE0[0xc]:(ENOVERRUN|ENIOERR)=20 CCSCBCTL[0x0]=20 ahd0: REG0 =3D=3D 0xb860, SINDEX =3D 0x10e, DINDEX =3D 0x106 ahd0: SCBPTR =3D=3D 0x1f1, SCB_NEXT =3D=3D 0xff40, SCB_NEXT2 =3D=3D 0x1fb CDB 12 0 0 80 88 9 STACK: 0x237 0x2 0x0 0x0 0x0 0x0 0x0 0x0 <<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>> (probe3:ahd0:0:3:0): inquiry data fails comparison at DV2 step (probe2:ahd0:0:2:0): inquiry data fails comparison at DV1 step (ahd0:A:3:0): refuses synchronous negotiation. Using asynchronous transfers (ahd0:A:2:0): refuses synchronous negotiation. Using asynchronous transfers da0 at ahd0 bus 0 scbus0 target 0 lun 0 da0: Fixed Direct Access SCSI-3 device=20 da0: Serial Number DAA0P7A054GD da0: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) da0: Command Queueing enabled da0: 140272MB (287277984 512 byte sectors: 255H 63S/T 17882C) cd0 at ata1 bus 0 scbus3 target 1 lun 0 cd0: Removable CD-ROM SCSI-0 device=20 cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present da2 at ahd0 bus 0 scbus0 target 2 lun 0 da2: Fixed Direct Access SCSI-3 device=20 da2: Serial Number 3KS2NFJG00007611CFPX da2: 3.300MB/s transfers da2: Command Queueing enabled da2: 140014MB (286749488 512 byte sectors: 255H 63S/T 17849C) da1 at ahd0 bus 0 scbus0 target 1 lun 0 da1: Fixed Direct Access SCSI-3 device=20 da1: Serial Number DAA0P7A054G3 da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) da1: Command Queueing enabled da1: 140272MB (287277984 512 byte sectors: 255H 63S/T 17882C) da3 at ahd0 bus 0 scbus0 target 3 lun 0 da3: Fixed Direct Access SCSI-3 device=20 da3: Serial Number 3KS1Z2KF00007620X9K1 da3: 3.300MB/s transfers da3: Command Queueing enabled da3: 140014MB (286749488 512 byte sectors: 255H 63S/T 17849C) ses0 at ahd0 bus 0 scbus0 target 6 lun 0 ses0: Fixed Processor SCSI-2 device=20 ses0: 3.300MB/s transfers ses0: SAF-TE Compliant Device SMP: AP CPU #1 Launched! SMP: AP CPU #3 Launched! SMP: AP CPU #2 Launched! Timecounter "TSC-low" frequency 1496279088 Hz quality 1000 Trying to mount root from ufs:/dev/da0s1a [rw]... --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 108 Turvey Cove, Hutto, TX 78634-5688 ----- End forwarded message ----- --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 108 Turvey Cove, Hutto, TX 78634-5688