From owner-freebsd-fs@FreeBSD.ORG Wed Oct 27 16:48:13 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB92616A4CE for ; Wed, 27 Oct 2004 16:48:13 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7441143D2F for ; Wed, 27 Oct 2004 16:48:13 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.1/8.13.1) with ESMTP id i9RGm5DS021247; Wed, 27 Oct 2004 09:48:09 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200410271648.i9RGm5DS021247@gw.catspoiler.org> Date: Wed, 27 Oct 2004 09:48:05 -0700 (PDT) From: Don Lewis To: freebsd-fs@merdin.com In-Reply-To: <162265023.20041027152045@merdin.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-fs@FreeBSD.org Subject: Re: Re[4]: panic again X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2004 16:48:14 -0000 On 27 Oct, Pavel Merdine wrote: > Hello , > > Maybe I was wrong, but looking at the FFS code I see that softupdates > does not work without -f : > if (fs->fs_clean == 0) { > fs->fs_flags |= FS_UNCLEAN; > if (ronly || (mp->mnt_flag & MNT_FORCE)) { > printf( "WARNING: %s was not properly dismounted\n", > fs->fs_fsmnt); > } else { > printf("WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", > fs->fs_fsmnt); > error = EPERM; > goto out; > } > } > The clean flag does not seem to be affected by softupdates. > > My practice tells me that fsck is always required after unclean > shutdown if I dont use -f. So what is the purpose of softupdates then? > I repeat that maybe I'm wrong. But I just didn't see it working. This appears to be the code from FreeBSD 4.x, which does not have the background fsck feature, so any unclean file systems must be fsck'ed before they are mounted. This does not depend on whether or not softupdates is enabled. Softupdates in FreeBSD 4.x is primarily just enhances file system write performance. Background fsck also requires the file system to have a snapshot capability so that fsck can run on the snapshot while the file system is mounted and possibly being modifed by other processes on the system. The snapshot feature is only present in FreeBSD 6.x and recent versions of FreeBSD 5.x. The equivalent block of code in FreeBSD 6-CURRENT is: if (fs->fs_clean == 0) { fs->fs_flags |= FS_UNCLEAN; if (ronly || (mp->mnt_flag & MNT_FORCE) || ((fs->fs_flags & FS_NEEDSFSCK) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { printf( "WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { printf( "WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", fs->fs_fsmnt); error = EPERM; goto out; } if ((fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) && (mp->mnt_flag & MNT_FORCE)) { printf("%s: lost blocks %jd files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; } } This code permits the file system to be mounted even if it is unclean as long as softupdates is enabled.