From owner-freebsd-bugs Wed Jun 27 15:40:10 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 E280537B401 for ; Wed, 27 Jun 2001 15:40:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5RMe5t91141; Wed, 27 Jun 2001 15:40:05 -0700 (PDT) (envelope-from gnats) Date: Wed, 27 Jun 2001 15:40:05 -0700 (PDT) Message-Id: <200106272240.f5RMe5t91141@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Umesh Krishnaswamy Subject: Re: kern/28465: Enabling softupdates on a clean but active filesystem can panic the kernel Reply-To: Umesh Krishnaswamy 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 kern/28465; it has been noted by GNATS. From: Umesh Krishnaswamy To: Dima Dorfman Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/28465: Enabling softupdates on a clean but active filesystem can panic the kernel Date: Wed, 27 Jun 2001 15:35:24 -0700 On Wed, Jun 27, 2001 at 03:01:01PM -0700, Dima Dorfman wrote: > Umesh Krishnaswamy writes: > > > > >Number: 28465 > > >Category: kern > > >Synopsis: Enabling softupdates on a clean but active filesystem can pa > > >Description: > > If you do a bunch of reads and writes to a filesystem, then mount it > > rdonly and enable softupdates, tunefs will allow you to do so, but > > the kernel will panic shortly afterwords with the following stack trace. > > I think the real bug is that downgrading to read-only doesn't work > properly. If that is the case, then we should patch tunefs to check if the filesystem is active. This patch can be applied to RELENG_4. The mainline code is slightly different. Umesh. Index: tunefs.c =================================================================== diff -u -p -r1.1.1.3 tunefs.c --- tunefs.c 2001/03/31 04:39:03 1.1.1.3 +++ tunefs.c 2001/06/27 22:33:34 @@ -88,7 +88,7 @@ main(argc, argv) int argc; char *argv[]; { - char *cp, *special, *name, *action; + char *cp, *special, *name; struct stat st; int i; int Aflag = 0, active = 0; @@ -201,17 +201,22 @@ again: if (argc < 1) errx(10, "-n: missing %s", name); argc--, argv++; - if (strcmp(*argv, "enable") == 0) { + if (active) { + warnx("%s cannot be changed while filesystem is active", name); + } else if (sblock.fs_clean == 0) { + warnx ("%s cannot be changed until fsck is run", name); + } else { + if (strcmp(*argv, "enable") == 0) { sblock.fs_flags |= FS_DOSOFTDEP; - action = "set"; - } else if (strcmp(*argv, "disable") == 0) { + warnx("%s set", name); + } else if (strcmp(*argv, "disable") == 0) { sblock.fs_flags &= ~FS_DOSOFTDEP; - action = "cleared"; - } else { + warnx("%s cleared", name); + } else { errx(10, "bad %s (options are %s)", name, "`enable' or `disable'"); - } - warnx("%s %s", name, action); + } + } continue; case 'o': To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message