From owner-freebsd-bugs@FreeBSD.ORG Sat Sep 25 03:13:06 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06668106566B; Sat, 25 Sep 2010 03:13:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0868FC15; Sat, 25 Sep 2010 03:13:04 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8P3Cln3032042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Sep 2010 13:13:03 +1000 Date: Sat, 25 Sep 2010 13:12:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: brucec@freebsd.org In-Reply-To: <201009242052.o8OKqaEk085455@freefall.freebsd.org> Message-ID: <20100925122853.W839@delplex.bde.org> References: <201009242052.o8OKqaEk085455@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org, freebsd-bugs@freebsd.org Subject: Re: bin/27687: fsck(8) wrapper is not properly passing options to fsck_ X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 03:13:06 -0000 On Fri, 24 Sep 2010 brucec@freebsd.org wrote: > Synopsis: fsck(8) wrapper is not properly passing options to fsck_ > > Responsible-Changed-From-To: freebsd-bugs->freebsd-fs > Responsible-Changed-By: brucec > Responsible-Changed-When: Fri Sep 24 20:52:17 UTC 2010 > Responsible-Changed-Why: > Over to maintainer(s). > > http://www.freebsd.org/cgi/query-pr.cgi?pr=27687 In fact, the description of the problem already shows that it isn't a problem: % >Description: % % If one boots single user and then does % fsck -b 32 /foo % fsck reports: % fsck: illegal option -- b % Usage: fsck [-BFdpvlyn] [-T fstype:fsoptions] [-t fstype] [special|node]... % one must use fsck_ffs directly even though fsck should have every % thing it needs from /etc/fstab to DTRT. As fsck reports, it has a -T option for passing options. -Tufs:-b32 seems to work right. The man page says more about this, but doesn't say what happens with multiple -T or -t options. I think they are concatenated at the fsck level, with the order preserved, and then filtered when passed. So "-T ufs:-b16,-y -Tmsdosfs:-n -Tufs:-b32,-n" passes "-b16 -y -b32 -n" to fsck_ffs and "-n" to fsck_msdosfs. The effect of multiple options is also undocumented in fsck_ffs. In practice, the last one usually has precedence, but "-b16 -b32 -b64" causes fsck_ffs to print that it uses 3 alternates (sic) although it actually only uses 1 alternative (sic) (the last one). Multiple alternatives are especially useless and dangerous for -b (especially with multiple special files), but I used them in these examples and testing because they are good for generating messages for both errors and success. Bruce