Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 1998 03:13:33 -0800 (PST)
From:      Mika Nystrom <mika@cs.caltech.edu>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/6189: VFS cache confuses the kernel when using amd (VFS cache is broken)
Message-ID:  <199804011113.DAA12444@obelix.cs.caltech.edu>

next in thread | raw e-mail | index | archive | help

>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 <sys/stat.h>
#include <sys/types.h>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804011113.DAA12444>