RELENG_6/i386/SMP NFS locking behavior

Vladimir Sharun sharun at ukr.net
Mon Aug 15 13:19:16 GMT 2005


2 weeks ago we switch our mx'es to 6.0-beta(1/2) and nfs locking
test tool hang in uninterruptbl state: ps axc shows state "D".
Without rpcbind/rpc.statd/rpc.lockd tool receives correct errno
45 EOPNOTSUPP Operation not supported.

Tool src (sniffed from @freebsd.org ML's):
==========8<============================================
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>

int main() {
  int lockfd;
  char* tempfile="/nfs/mount/testfile";

  lockfd=open(tempfile,O_CREAT);
  printf("Open errno:   %d\n",errno);
  if (flock(lockfd, LOCK_SH|LOCK_NB)==-1) {
    printf("ERROR shared lock:  %d\n",errno);
  }
  if (flock(lockfd, LOCK_EX|LOCK_NB)==-1) {
    printf("ERROR exclusive lock:  %d\n",errno);
  }
   close(lockfd);
}
==========8<============================================



More information about the freebsd-fs mailing list