From owner-freebsd-bugs Wed Apr 1 03:20:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA06731 for freebsd-bugs-outgoing; Wed, 1 Apr 1998 03:20:02 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA06714; Wed, 1 Apr 1998 03:20:01 -0800 (PST) (envelope-from gnats) Received: from vlsi.cs.caltech.edu (vlsi.cs.caltech.edu [131.215.131.129]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id DAA05881 for ; Wed, 1 Apr 1998 03:13:35 -0800 (PST) (envelope-from mika@obelix.cs.caltech.edu) Received: from obelix.cs.caltech.edu by vlsi.cs.caltech.edu (4.1/1.34.1) id AA10804; Wed, 1 Apr 98 03:13:34 PST Received: (from mika@localhost) by obelix.cs.caltech.edu (8.8.8/8.8.7) id DAA12444; Wed, 1 Apr 1998 03:13:33 -0800 (PST) Message-Id: <199804011113.DAA12444@obelix.cs.caltech.edu> Date: Wed, 1 Apr 1998 03:13:33 -0800 (PST) From: Mika Nystrom Reply-To: mika@cs.caltech.edu To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/6189: VFS cache confuses the kernel when using amd (VFS cache is broken) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6189 >Category: kern >Synopsis: VFS cache confuses the kernel when using amd (VFS cache is broken) >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 1 03:20:00 PST 1998 >Last-Modified: >Originator: Mika Nystrom >Organization: California Institute of Technology >Release: FreeBSD 3.0-CURRENT i386 >Environment: Dual PPro 3.0-CURRENT SMP system. Earlier tests indicate problem is not isolated to the SMP universe. Misreported as an amd problem due to insufficient debugging. >Description: We are heavy users of (amd-)automounted filesystems. We use the directory /ufs as the "home" for amd and use /tmp_mnt for the mountpoints. To refresh your memory, as far as I understand, the way amd works is like this.. let me take an example.. my mail spool is /ufs/mail/mika, when I examine it, the following takes place: kernel asks amd (which is masquerading as an NFS server) about /ufs/mail/mika, gets returned something that tells it there's a symlink from /ufs/mail to /tmp_mnt/vlsi/var/spool/mail (which has by now been automounted) and then does whatever to the file /tmp_mnt/vlsi/var/spool/mail/mika. The problem seems to be that the symlink /ufs/mail is somehow cached by the kernel after amd has decided to umount the system, causing the system to try to look up a nonexistent file. To verify the problem, I ran the following repeatedly: amq -u /ufs/mail ; ./a.out where a.out was compiled from: #include #include struct stat sb; main() { printf("%d\n",stat("/ufs/mail/mika",&sb)); } When run repeatedly, this command line alternates a zero output (success) with many -1 outputs (failure). Running amd in full debug mode and running ktrace on amd shows that in the -1 cases, 1. amd does not output any debugging information (even at the highest debug level) and 2. amd does not do anything caught by ktrace (kdump.out does not grow). This indicates that the kernel is doing something Wrong, caching the symlink. This was verified by setting debug.vfscache to 0 through sysctl, after which amd automounts appear to work perfectly. >How-To-Repeat: See above. >Fix: Quick workaround: sysctl -w -n debug.vfscache=0 Proper fix: unknown, but has something to do with the vfscache! (I suppose it is possible amd is misbehaving somehow, confusing the caching functions...) >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message