From owner-freebsd-bugs Mon Oct 15 8:30:12 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EE80137B409 for ; Mon, 15 Oct 2001 08:30:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9FFU1F89614; Mon, 15 Oct 2001 08:30:01 -0700 (PDT) (envelope-from gnats) Date: Mon, 15 Oct 2001 08:30:01 -0700 (PDT) Message-Id: <200110151530.f9FFU1F89614@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: bin/31199: tunefs error is incorrect when enabling softupdates Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/31199; it has been noted by GNATS. From: Bruce Evans To: "Crist J. Clark" Cc: Subject: Re: bin/31199: tunefs error is incorrect when enabling softupdates Date: Tue, 16 Oct 2001 01:22:37 +1000 (EST) On Mon, 15 Oct 2001, Crist J. Clark wrote: > On Wed, Oct 10, 2001 at 11:46:07AM -0400, Rob Simmons wrote: > ... > > >How-To-Repeat: > > run "tunefs -n enable " on a mounted filesystem. > > > > You will get the following output: > > > > bash-2.05$ tunefs -n enable /dev/ad0s1a > > tunefs: soft updates set > > tunefs: cannot open /dev/ad0s1a: Permission denied > > Looking at the code, I think the least obtrusive way to fix this is to > slightly reword the messages a little more clear. tunefs(8) goes > through all of the options before it actually tries to modify the file > system. This was broken in rev.1.12. tunefs previously opened the device with mode O_RDWR (spelled as "2") up front in getsb(). This was bogus for the -p case since it required write access to display the settings, but is needed for all other cases since tunefs writes even null changes. > The messages should reflect that it is collecting the values > before it actually tries to write them. Something more like, > > $ tunefs -n enable /dev/ad0s1a > tunefs: setting soft updates... > tunefs: cannot open /dev/ad0s1a: Permission denied The "setting" message used to be "soft updates set". I changed this to "soft updates changes from disabled to enabled" (and similarly for "soft updates cleared" so that the wording is similar for all the messages. > And in a successful run (since tunefs(8) is already chatty on > success), > > $ tunefs -n enable /dev/ad0s1a > tunefs: setting soft updates... > tunefs: changes on /dev/ad0s1 done The "changes done" message is silly if tunefs has only printed "remains unchanged" messages. > This patch look good? > > Index: tunefs.c > =================================================================== > RCS file: /export/ncvs/src/sbin/tunefs/tunefs.c,v > retrieving revision 1.20 > diff -u -r1.20 tunefs.c > --- tunefs.c 2001/09/30 14:57:08 1.20 > +++ tunefs.c 2001/10/15 09:43:07 > @@ -231,7 +231,7 @@ > warnx("%s remains unchanged as %d", name, avalue); > } > else { > - warnx("%s changes from %d to %d", > + warnx("changing %s from %d to %d...", > name, sblock.fs_maxcontig, avalue); > sblock.fs_maxcontig = avalue; > } I don't think this is any better. The unusual wording in the original was apparently chosen to put the subject first. Neither version claims to have completed the changes (that would be "%s changed"). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message