From owner-svn-src-head@FreeBSD.ORG Fri Dec 12 16:14:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6231065673; Fri, 12 Dec 2008 16:14:53 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mx1.freebsd.org (Postfix) with ESMTP id 09D808FC13; Fri, 12 Dec 2008 16:14:52 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so1460959wfg.7 for ; Fri, 12 Dec 2008 08:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=a3d5G6RTH1pVsuY4nDLc3TW/vQBzgvblAsg2U9AmT98=; b=tAWcX2C3DBigKmsTzL+Mog3Og/KyfgDZGXMVHTCgaV/dzk4a9RAEmQk6iyqiR4gc9z KDlKZV5zqGFv2FAwOWNs063Wq3wbVmAQ9XY2VJ54WMTy9RVGeUFnhojgd/hJfsoA3bvy pp1a0VbAxl1gubeRUlPtYSjFtJx9v9QfEPLD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=LMiIgTcuOrlJRIAHIMACJvgkrLO6wxWRHk2hzTpBgRq3MSAnBJcc2c4fW6lZQ1VltF MfRzjqlD6ASo96zjoBSUPwjUgXmCmfZr0p335iwIKMZ23wmKzUayqDW/hyqmOwItOMgr iOGESapiKSsyY/fAbdhV135OBeUZCkhXIEO8o= Received: by 10.142.135.13 with SMTP id i13mr1412692wfd.217.1229098492783; Fri, 12 Dec 2008 08:14:52 -0800 (PST) Received: by 10.142.125.20 with HTTP; Fri, 12 Dec 2008 08:14:52 -0800 (PST) Message-ID: <5c0ff6a70812120814t2c184ec1jc05953a3db9ed319@mail.gmail.com> Date: Fri, 12 Dec 2008 08:14:52 -0800 From: "Paul Saab" Sender: paul.m.saab@gmail.com To: "Luigi Rizzo" In-Reply-To: <200812121556.mBCFucKf001837@svn.freebsd.org> MIME-Version: 1.0 References: <200812121556.mBCFucKf001837@svn.freebsd.org> X-Google-Sender-Auth: c4170f85f645aa02 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185990 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 16:14:53 -0000 This still will not work. zfs can have arbitrary names. On Fri, Dec 12, 2008 at 7:56 AM, Luigi Rizzo wrote: > Author: luigi > Date: Fri Dec 12 15:56:38 2008 > New Revision: 185990 > URL: http://svn.freebsd.org/changeset/base/185990 > > Log: > Move the check for the ending char in the partition name where > it was before -- the check is only made when getdisklabel() > returns valid info. > On passing, use MAXPARTITIONS to identify the max partition number, > instead of the hardwired 'h' > > MFC after: 4 weeks > > Modified: > head/sbin/newfs/newfs.c > > Modified: head/sbin/newfs/newfs.c > > ============================================================================== > --- head/sbin/newfs/newfs.c Fri Dec 12 14:57:25 2008 (r185989) > +++ head/sbin/newfs/newfs.c Fri Dec 12 15:56:38 2008 (r185990) > @@ -354,11 +354,6 @@ main(int argc, char *argv[]) > mediasize = st.st_size; > /* set fssize from the partition */ > } else { > - part_name = special[strlen(special) - 1]; > - if ((part_name < 'a' || part_name > 'h') && > !isdigit(part_name)) > - errx(1, "%s: can't figure out file system partition", > - special); > - > if (sectorsize == 0) > if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) > sectorsize = 0; /* back out on error for safety */ > @@ -368,6 +363,12 @@ main(int argc, char *argv[]) > pp = NULL; > lp = getdisklabel(special); > if (lp != NULL) { > + if (!is_file) /* already set for files */ > + part_name = special[strlen(special) - 1]; > + if ((part_name < 'a' || part_name - 'a' >= MAXPARTITIONS) > && > + !isdigit(part_name)) > + errx(1, "%s: can't figure out file system > partition", > + special); > cp = &part_name; > if (isdigit(*cp)) > pp = &lp->d_partitions[RAW_PART]; >