[OpenAFS] openafs panic after chroot

emoy@apple.com emoy@apple.com
Tue, 11 Feb 2003 01:28:53 -0800


On Monday, February 10, 2003, at 08:35  AM, Chaskiel M Grundman wrote:

> --On Monday, February 10, 2003 00:31:16 -0800 emoy@apple.com wrote:
>
>> The backtrace shows afs_FlushActiveVcaches (called from afs_Daemon,
>> itself called from afs_syscall_call) calling panic:
>>
>> # ifdef AFS_DARWIN_ENV
>>              if (VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) {
>>                  if (tvc->opens) panic("flushactive open, hasubc, but
>> refcnt 1");                  osi_VM_TryReclaim(tvc,0);
>>              }
>> # endif
> This code is testing for what _should_ be an impossible condition.
>
> There should be one reference for each open, and one reference for the  
> VM
> system. Because the vnode is inconsistent, afs doesn't know what to do  
> with
> it, and rather than let the kernel panic with some inscrutable message
> later, I decided to report the inconsistency as soon as it was  
> discovered.
>
> I'm not sure what this could have to do with a chroot. Only VREG nodes
> (normal files) can have UBCINFOEXISTS be true, directories cannot. I
> suspect that the chroot is a red herring, and there's still a generic
> problem with executables in afs.

The panic is reproducible, every time I run chroot.  I've tried running  
executables (without chroot) and I see no problems, but that doesn't  
cause dynamic libraries to load from AFS.

I replaced the panic() call with a printf(), and going in and out of  
chroot a couple of times resulted in the following from the system log  
file:

Feb 10 19:34:08 proton mach_kernel: flushactive open, hasubc, but  
refcnt 1
Feb 10 19:34:58 proton mach_kernel: afs: WARNING: ui_refcount panic  
averted
Feb 10 19:34:58 proton last message repeated 3 times
Feb 10 19:35:21 proton mach_kernel: flushactive open, hasubc, but  
refcnt 1
Feb 10 19:36:34 proton mach_kernel: flushactive open, hasubc, but  
refcnt 1

So far, there are no ill affects, and it lets me continue my testing.   
However, fixing this problem correctly would be better.

I did try dynamic libraries from AFS.  Using a Perl program, which  
calls a Perl extension (in AFS) which links with a dynamic library  
(also in AFS) does cause the following messages:

Feb 11 01:21:49 proton mach_kernel: afs: WARNING: ui_refcount panic  
averted
Feb 11 01:21:50 proton last message repeated 2 times
Feb 11 01:27:19 proton mach_kernel: afs: WARNING: ui_refcount panic  
averted

but no flushactive message.
------------------------------------------------------------------------ 
--
Edward Moy
Apple Computer, Inc.
emoy@apple.com

(This message is from me as a reader of this list, and not a statement
from Apple.)