From owner-freebsd-current@FreeBSD.ORG Mon May 14 00:53:47 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org 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 AF83716A400 for ; Mon, 14 May 2007 00:53:47 +0000 (UTC) (envelope-from quetzal@zone3000.net) Received: from mx1.sitevalley.com (sitevalley.com [209.67.60.43]) by mx1.freebsd.org (Postfix) with SMTP id 6678813C43E for ; Mon, 14 May 2007 00:53:47 +0000 (UTC) (envelope-from quetzal@zone3000.net) Received: from zone3000.kharkov.ua (HELO localhost) (217.144.69.37) by 209.67.61.254 with SMTP; 14 May 2007 00:53:46 -0000 Date: Mon, 14 May 2007 03:53:20 +0300 From: Nikolay Pavlov To: Yuriy Tsibizov Message-ID: <20070514005320.GA21922@zone3000.net> Mail-Followup-To: Nikolay Pavlov , Yuriy Tsibizov , Stefan Farfeleder , freebsd-current@freebsd.org References: <20070509125720.U911@free.home.local> <20070512104053.J943@free.home.local> <20070512071231.GB944@lizard.fafoe.narf.at> <20070512201809.F944@free.home.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070512201809.F944@free.home.local> X-Operating-System: FreeBSD 6.1-RELEASE-p10 User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: Stefan Farfeleder , freebsd-current@freebsd.org Subject: Re: geom_label problems when MS-DOS FS label is blank (all spaces) 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, 14 May 2007 00:53:47 -0000 On Saturday, 12 May 2007 at 20:43:16 +0400, Yuriy Tsibizov wrote: > On Sat, 12 May 2007, Stefan Farfeleder wrote: > >On Sat, May 12, 2007 at 10:51:25AM +0400, Yuriy Tsibizov wrote: > >>>In this situation libdisk can't parse kern.geom.conftxt and sysinstall > >>>exits with BARF 171 message. What about this one bug: Probing devices, please wait (this can take a while)...BARF 170 <105> I am unable to use sysinstall due to it. > >> > >> It can be fixed with following patch. "all spaces" volume will be treated > >> like a volume without label. > >> > >> Index: g_label_msdosfs.c > >> =================================================================== > >> RCS file: /home/ncvs/src/sys/geom/label/g_label_msdosfs.c,v > >> retrieving revision 1.6 > >> diff -u -r1.6 g_label_msdosfs.c > >> --- g_label_msdosfs.c 30 Sep 2006 08:16:49 -0000 1.6 > >> +++ g_label_msdosfs.c 12 May 2007 06:39:23 -0000 > >> @@ -200,7 +200,7 @@ > >> } > >> > >> endofchecks: > >> - for (i = size - 1; i > 0; i--) { > >> + for (i = size - 1; i >= 0; i--) { > >> if (label[i] == '\0') > >> continue; > >> else if (label[i] == ' ') > > > >This won't work because i is unsigned. > > Ok, I see that this patch is not correct. > > Do you like this one? > > Index: g_label_msdosfs.c > =================================================================== > RCS file: /home/ncvs/src/sys/geom/label/g_label_msdosfs.c,v > retrieving revision 1.6 > diff -u -r1.6 g_label_msdosfs.c > --- g_label_msdosfs.c 30 Sep 2006 08:16:49 -0000 1.6 > +++ g_label_msdosfs.c 12 May 2007 13:37:06 -0000 > @@ -208,6 +208,8 @@ > else > break; > } > + if (label[i] == ' ') > + label[i] = '\0'; > > error: > if (sector0 != NULL) > > (there is no need to check for i == 0, because label[i] is not equal > to ' ' if i > 0 after for() loop) > > Yuriy. > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" -- ====================================================================== - Best regards, Nikolay Pavlov. <<<----------------------------------- ======================================================================