Date: Wed, 27 Jun 2001 15:40:05 -0700 (PDT) From: Umesh Krishnaswamy <umesh@juniper.net> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/28465: Enabling softupdates on a clean but active filesystem can panic the kernel Message-ID: <200106272240.f5RMe5t91141@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/28465; it has been noted by GNATS.
From: Umesh Krishnaswamy <umesh@juniper.net>
To: Dima Dorfman <dima@unixfreak.org>
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 <umesh@juniper.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106272240.f5RMe5t91141>
