From owner-freebsd-hackers Thu Oct 22 15:39:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA14011 for freebsd-hackers-outgoing; Thu, 22 Oct 1998 15:39:45 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA14003 for ; Thu, 22 Oct 1998 15:39:44 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from sunrise.gv.tsc.tdk.com (root@sunrise.gv.tsc.tdk.com [192.168.241.191]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id PAA06077; Thu, 22 Oct 1998 15:37:46 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by sunrise.gv.tsc.tdk.com (8.8.5/8.8.5) with ESMTP id PAA11009; Thu, 22 Oct 1998 15:37:45 -0700 (PDT) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id PAA17114; Thu, 22 Oct 1998 15:37:39 -0700 (PDT) From: Don Lewis Message-Id: <199810222237.PAA17114@salsa.gv.tsc.tdk.com> Date: Thu, 22 Oct 1998 15:37:38 -0700 In-Reply-To: Kirk McKusick "Re: softupdates and sync" (Oct 19, 8:42pm) X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95) To: Kirk McKusick , dag-erli@ifi.uio.no Subject: Re: softupdates and sync Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Oct 19, 8:42pm, Kirk McKusick wrote: } Subject: Re: softupdates and sync } The sync system call goes through all the mounted filesystems } calling VFS_SYNC. In the case of UFS, this gets us to ffs_sync } which walks the vnode list doing VOP_FSYNC with MNT_NOWAIT set. } VOP_FSYNC will walk the dirty list associated with the vnode doing } bawrite (or bdwrite/vfs_bio_awrite if B_CLUSTEROK is set). I } suspect that the problem has to do with the interaction with the } new VM's system desire to dissolve buffers, leaving the dirty page } identified only in the page cache. Thus it is not found by the } above sequence of events. It is not until the unmount occurs that } the VM system flushes out the dirty pages associated with the mount } point. I wonder if this is related to: On Oct 14, 5:06pm, Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= wrote: } Subject: SoftUpdates anomaly: what happens when you 'mount -u -o ro /usr'? } I woke up to find my nightly doc build had failed due to a full /usr } partition. It's a 256MB partition with 160MB of data on it, so there } had to be a catch somewhere. I ran 'fsck -n' which revealed 13,500 } unreferenced files. } } I got a little scared and fsck'ed all my other file systems. Only one } had errors: /mp3 (where I keep my MP3 archive). } } Both /usr and /mp3 were supposedly clean. I had a power outage a } couple of days ago and fsck -p at bootup revealed nothing, which isn't } surprising since they're usually mounted ro so they were marked as } clean. } } /mp3 *may* have been hit by the fsck bug since it's "old enough", but } /usr was newfs'ed after it had gone totally bananas (remember the } problems I had with my streamer timing out during 'mt fsf'? That was } when I restored /usr after newfs'ing it). At the time I thought it had } been hit by the fsck bug which had just been fixed. } } I thought a little more about it and found that /usr and /mp3 had one } thing in common: they're both usually mounted ro, but I occasionally } mount them rw for specific thing (make installworld, building the } docs, dumping a CD). To take installworld as an example, what I do is: } } # cd /usr/src } # mount -u -o rw /usr } # make installworld } # mount -u -o ro /usr } } (I have a script which does this of course) } } Now looking through the fsck output (I scripted it) it seems that the } unreferenced files were mostly binaries, and I bet if I looked closer } I'd find out the mtimes are consistent with days I've run make world. } What's more, I'm not missing any files; my bet is that the } unreferenced files are files which have been deleted (replaced) by } installworld. They're unreferenced because they were unlinked, but for } some reason they were never freed. I think somebody with more fs } experience than I have should take a look at what happens to a } softupdates fs when it is switched from rw to ro. It seems obvious to } me that pending writes should be flushed; it also appears that this } doesn't actually happen. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message