NetBSD Problem Report #24813

Received: (qmail 1455 invoked by uid 605); 17 Mar 2004 09:39:03 -0000
Message-Id: <20040317093858.7776816B0C@cancel.kyoto.jone-system.com>
Date: Wed, 17 Mar 2004 18:38:58 +0900 (JST)
From: taca@kyoto.jone-system.com
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: taca@kyoto.jone-system.com
To: gnats-bugs@gnats.netbsd.org
Subject: Explicitly log dirty root file system
X-Send-Pr-Version: 3.95

>Number:         24813
>Category:       kern
>Synopsis:       Explicitly log dirty root file system
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 17 09:40:00 +0000 2004
>Closed-Date:    
>Last-Modified:  
>Originator:     Taca Takahiro Kambe
>Release:        NetBSD 1.6.2
>Organization:

>Environment:


System: NetBSD cancel.kyoto.jone-system.com 1.6.2 NetBSD 1.6.2 (CANCEL) #67: Sat Jan 31 08:37:30 JST 2004 support@kyoto.jone-system.com:/usr/src/sys/arch/i386/compile/CANCEL i386
Architecture: i386
Machine: i386
>Description:
	When the root file system wasn't unmounted cleanly,  fsck(8)
	normally would fix the file system.  But the root file system's
	dirty status isn't recorded, only it would be found no console.

	On old FreeBSD (I don't know recent release), it was logged as:

		WARNING: / was not properly dismounted.

>How-To-Repeat:
	Power off the machine without normal shutdown and switch on.
	After system up again, you wouldn't found whether fsck(8) was
	performed or not.
>Fix:
	Adding simple log.

diff -u src/sys/ufs/ffs/ffs_vfsops.c.orig src/sys/ufs/ffs/ffs_vfsops.c
--- sys/ufs/ffs/ffs_vfsops.c	25 Sep 2003 10:03:49 -0000	1.1.1.1.2.1
+++ sys/ufs/ffs/ffs_vfsops.c	17 Mar 2004 09:33:49 -0000
@@ -165,6 +165,8 @@ ffs_mountroot()
 	(void)ffs_statfs(mp, &mp->mnt_stat, p);
 	vfs_unbusy(mp);
 	inittodr(fs->fs_time);
+	if ((fs->fs_clean & FS_ISCLEAN) == 0)
+		printf("WARNING: root device was not properly unmounted.\n");
 	return (0);
 }

>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.