[OpenAFS] problem about calling uafs_Init() on SMP and PC

wangkun@legend.com.cn wangkun@legend.com.cn
Fri, 5 Apr 2002 14:46:08 +0800


I call uafs_Init() to initialize the user space client. On PC,everything is
ok.But when I migrate my code on any SMP machines which have 2 CPU or
more,the calling always fails.The following is error message when I run my
code on a SMP with 2 CPU:

uafs: Initializing user space AFS client

    mountDir:           /afs
    confDir:            /usr/vice/etc
    cacheBaseDir:       /usr/vice/cache1
    cacheBlocks:        20000
    cacheFiles:         1000
    cacheStatEntries:   1000
    dCacheSize:         10
    vCacheSize:         100
    chunkSize:          0
    afsd_CloseSynch:    0
    afsd_debug/verbose: 0/0
    nDaemons:           3
    cacheFlags:         0
    logFile:            /usr/vice/etc/efs_log

java: ../rx/rx_knet.c:230: rxk_InitializeSocket: Assertion `optval ==
optval0' failed.


I traced the error into AFS source code /src/rx/UKERNEL/kx_knet.c and found
that there are difference between the values of optval and optval0 after
calling getsockopt().
     optval=262140
     optval0=131070
so usr_assert(optval == optval0) creates an abort.

I thinked it must be the number of cpu which introduce the problem because
optval=2*optval0 in above case. I tested by fixing optval0 as 262140,there
was still an error because optval was got as 262142.
Finally,it worked well when I fixed optval0 as 262142.

The the problem is sovled ,I still want to know why these happened? I can
not deal with flexible system environment because SMP machines carry
different number of CPU.

Is it a defect on AFS source code. How to solve the problem?
Please help me .Thanks.