From owner-freebsd-hackers Sun Apr 13 13:00:19 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA21249 for hackers-outgoing; Sun, 13 Apr 1997 13:00:19 -0700 (PDT) Received: from gateway.cybernet.com (gateway.cybernet.com [192.245.33.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA21227; Sun, 13 Apr 1997 13:00:12 -0700 (PDT) Received: from spiffy.cybernet.com (spiffy.cybernet.com [192.245.33.55]) by gateway.cybernet.com (8.7.6/8.7.3) with SMTP id QAA05967; Sun, 13 Apr 1997 16:02:54 -0400 (EDT) Message-ID: X-Mailer: XFMail 1.1-alpha [p0] on FreeBSD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Sun, 13 Apr 1997 14:38:47 -0400 (EDT) Organization: Cybernet Systems Corporation From: Mark Taylor To: hackers@freebsd.org, bugs@freebsd.org Subject: vnode as filesystem (crash!) Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm trying to use a vnode as a file system. I have no problem "vnconfig"ing and "newfs"ing it (a 10 MB test case, derived from "dd" and /dev/zero). The problem comes when I start creating files on the mounted vnode. I can get a few hundred files created (this is a random number: sometimes a few hundred, but never more than two thousand), and then it hangs the system (actually, sometimes it causes a reboot). No panics, no kernel messages, just a hang/reboot. I haven't tried the kernel debugger yet (I don't know how to use it [yet].). :) OS is FreeBSD 2.2.1-RELEASE. I've tried it on five other machines, all with the same results. (All machines have at least 100 MBytes of swap space, if that matters. None of which is used during these tests, though). The results are universal, and exactly the same. I've come up with a "fix": 1) In the makefiles script, I cause a 'sync' every 100 files created, and all is fine- all of the 7500 files get created. 2) Instead of the /bin/sync in the script, I change kern.update from the default 30 to 5. All 7500 files get made, no problem. So there seems to be a problem with the vm/fs cache? I'd hate to live with a 5 second update time. The sequence of events is: dd if=/dev/zero of=/tmp/T0 bs=1024 count=10240 vnconfig -c -s labels /dev/vn0 /tmp/T0 disklabel -w -r vn0 tenmeg newfs -i 1024 /dev/vn0a # need lots of inodes for makefiles created files mount /dev/vn0a /mnt /root/bin/makefiles # script to create 100 files per directory of 1k each (system hangs/reboots in a few seconds, no messages) The disklabel tenmeg (from /etc/distab): tenmeg:ty=mfs:se#512:nt#1:rm#300:\ :ns#20480:nc#1:\ :pa#20480:oa#0:ba#4096:fa#512:ta=4.2BSD:\ :pc#20480:oc#0:bc#4096:fc#512: The "makefiles" script: (it's a hack- no comments please!) #!/bin/csh set i=0 set files=100 mkdir $files; cd $files while ( `/bin/test $files -gt 7500; echo -n $status` ) # echo -n "$files " if ( `/bin/test $i -ne 100; echo -n $status` ) then echo "$files" #/bin/sync cd .. mkdir $files cd $files set i=0 endif @ i++ dd if=/dev/zero of=$i bs=1024 count=1 >& /dev/null @ files++ end echo "" Please include my email address in responses, as I am not directly on the hackers list. -------------------------------------------------------------------- Mark J. Taylor Network R&D Manager Cybernet Systems mtaylor@cybernet.com 727 Airport Blvd. PHONE (313) 668-2567 Ann Arbor, MI 48108 FAX (313) 668-8780 --------------------------------------------------------------------