Date: Thu, 22 Oct 1998 15:37:38 -0700 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: Kirk McKusick <mckusick@McKusick.COM>, dag-erli@ifi.uio.no Cc: hackers@FreeBSD.ORG Subject: Re: softupdates and sync Message-ID: <199810222237.PAA17114@salsa.gv.tsc.tdk.com> In-Reply-To: Kirk McKusick <mckusick@McKusick.COM> "Re: softupdates and sync" (Oct 19, 8:42pm)
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810222237.PAA17114>
