[OpenAFS-port-freebsd] Accessing /afs from FreeBSD Linux emulation

Jan Henrik Sylvester me@janh.de
Wed, 20 Apr 2016 11:18:01 +0200


On 04/16/2016 20:39, Benjamin Kaduk wrote:
> On Sat, 16 Apr 2016, Jan Henrik Sylvester wrote:
> 
>> [Resend, since the first one is in moderation for a few days now.]
>>
>> On 10.3-RELEASE/amd64, I just tried to access /afs from the Linux
>> emulation on a remote machine -- now that machine does not even react to
>> ping anymore. I reproduced part of the problem locally on another machine:
>>
>> /compat/linux/bin/bash
>> ls /afs
>>
>> The (Linux) ls process consumes a whole CPU core, outputs nothing, and
>> is unkillable. Of course, /afs is busy and I cannot umount it, either,
>> making a clean shutdown of the machine impossible.
>>
>> On one machine, it was a 64bit Linux environment
>> (linux_base-c6_64-6.7_1), on the other, it was a 32bit Linux environment
>> (linux_base-c6-6.7_1).
>>
>> Is accessing /afs from the Linux emulation supposed to work?
> 
> I can't speak to whether it has ever actually worked, and I don't have a
> strong understanding of the architecture of the linux emulation layer, but
> yes, I would expect it to be able to work.

I was hoping to run newer versions of Matlab installed to our AFS now
that we have 64bit Linux emulation, but in the meantime I did a local
installation of Matlab and could not get it to work, either. I may try
to solve that on emulation@freebsd, but since I do not really need
Matlab on FreeBSD, I am not sure, how much effort I am going to put into
it. Anyhow, the problem of AFS with the Linux emulation is independent,
but for the same reason, not high priority for me, either.

Since I am still using openafs-1.6.15 on 10.3-RELEASE build on
10.2-RELEASE and since I did not want to trash my working machine again,
I have done a clean install into a VirtualBox, see the steps to
reproduce below. Linux ls /afs still hangs on 10.3-RELEASE with OpenAFS
build from ports as well as on 10.1-RELEASE with OpenAFS from quarterly
packages.

> Can you get the procstat -kk <pid> output for the hung process?

  PID    TID COMM             TDNAME           KSTACK
92017 100083 ls               -                mi_switch+0xe1
 critical_exit+0x7a lapic_handle_timer+0xae Xtimerint+0x8c
 VOP_READDIR_APV+0xa7 getdents_common+0x28d ia32_syscall+0x3a0
 Xint0x80_syscall+0x95

> Since it's a release kernel, I assume there's no WITNESS enabled ... any
> interest in building a debug kernel and trying again?

If that really helps, I may try to do that later. I have not done kernel
debugging before. What options should I use in this case? Do I have to
rebuild openafs?

Would testing with openafs-1.6.17 or 1.6.18pre1 be of any advantage? Is
the 10.3-RELEASE support more than just a copy of the 10.2 param file?
If yet, do you happen to have an update to the port not yet committed?

Thanks,
Jan Henrik



#root @ VirtulBox from
#ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/
#10.1-RELEASE/amd64/Latest/FreeBSD-10.1-RELEASE-amd64.vmdk.xz
#62365d4c5cb4c0d2166aa17d3055bd1eb11031197cf0f4a941e82c7052d5bd1a

ifconfig em0 up
dhclient em0
sed -i '' s/latest/quarterly/ /etc/pkg/FreeBSD.conf
pkg install openafs
kldload linux
sysctl compat.linux.osrelease=2.6.18
pkg install linux_base-c6
service afsd onestart
/compat/linux/bin/sh
ls /afs
# => hang



#root @ VirtulBox from
#ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/
#10.3-RELEASE/amd64/Latest/FreeBSD-10.3-RELEASE-amd64.vmdk.xz
#e833b0d1f82c4c776b3d6f7b280cf43380f4142894bf727d1557ccd85d0627d2

ifconfig em0 up
dhclient em0
portsnap fetch && portsnap extract
fetch
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/10.3-RELEASE/src.txz
tar -C / -xf src.txz
setenv BATCH
make -C /usr/ports/net/openafs/ install clean
cd /usr/ports/net/openafs/work/openafs-1.6.15/src/config
cp -p param.amd64_fbsd_102.h param.amd64_fbsd_103.h
cd
make -C /usr/ports/net/openafs/ install clean
kldload linux
make -C /usr/ports/emulators/linux_base-c6/ install clean
service afsd onestart
/compat/linux/bin/sh
ls /afs
# => hang