Date: Mon, 15 Oct 2001 08:30:01 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/31199: tunefs error is incorrect when enabling softupdates Message-ID: <200110151530.f9FFU1F89614@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/31199; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: "Crist J. Clark" <cristjc@earthlink.net> Cc: <freebsd-gnats-submit@FreeBSD.ORG> 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 <fs>" 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110151530.f9FFU1F89614>