[Linux-cluster] What can cause dlm_pthread_init to generate an errno 13?

Eric Johnson johnson.eric at gmail.com
Fri Nov 3 20:39:45 UTC 2006


> Looking at the examples in cluster/dlm/tests/usertest/ I think that you'll
> wan't dlm_ls_pthread_init() and not dlm_pthread_init() after you've
> created your lockspace.

Ok, so I'm further ahead.  I created my own lockspace with a program like this.

[ejohnson at gfsa01:~/projects/dlm-simple] cat bar.cpp
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>

extern "C" {
  #include <libdlm.h>
}
#include <pthread.h>

main(int argc, char **argv)
{
  printf("hello world\n");
  char lockName[] = "foobar" ;

  dlm_lshandle_t *lockspace=0;
  lockspace=(dlm_lshandle_t*)dlm_create_lockspace("EEJ_TESTING_LOCKSPACE",0777);
  printf("lockspace result: %X\n",lockspace);
}

And I can verify that it really produced something.  Because I see this...

[ejohnson at gfsa01:/proc/cluster] cat services
Service          Name                              GID LID State     Code
Fence Domain:    "default"                           1   2 run       -
[3 2 1]

DLM Lock Space:  "clvmd"                             2   3 run       -
[3 2 1]

DLM Lock Space:  "GFS1"                              4   4 run       -
[3 2 1]

DLM Lock Space:  "EEJ_TESTING_LOCKSPACE"             9   7 run       -
[1]

GFS Mount Group: "GFS1"                              5   5 run       -
[3 2 1]

User:            "usrm::manager"                     3   6 run       -
[3 2 1]

And, I can see this too...

[ejohnson at gfsa01:/dev/misc] ls -asl
total 0
0 drwxr-xr-x   2 root root    100 Nov  3 13:50 ./
0 drwxr-xr-x  13 root root   5700 Nov  3 13:50 ../
0 crw-------   1 root root 10, 62 Aug 30 16:07 dlm-control
0 crwxr-xr-x   1 root root 10, 60 Nov  3 13:50 dlm_EEJ_TESTING_LOCKSPACE
0 crw-------   1 root root 10, 61 Aug 30 16:07 dlm_clvmd

So I must be getting closer!

BUT - note the permissions on the dlm_EEJ* "file".  Not quite the 777
I had supplied in dlm_create_lockspace.  Hmpf.  Is that good?

I wonder if that explains why this program still gets a null returned
from dlm_open_lockspace.

[ejohnson at gfsa01:~/projects/dlm-simple] cat foo.cpp
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>

extern "C" {
  #include <libdlm.h>
}
#include <pthread.h>

main(int argc, char **argv)
{
  printf("hello world\n");
  char lockName[] = "foobar" ;

  dlm_lshandle_t *lockspace=0;
  lockspace=(dlm_lshandle_t*)dlm_open_lockspace("EEJ_TESTING_LOCKSPACE");
  printf("Lockspace: %X\n",lockspace);

  int initStatus = dlm_ls_pthread_init(lockspace);
  printf("initStatus: %d, errno: %d\n",initStatus,errno);
  return 1;
}

[ejohnson at gfsa01:~/projects/dlm-simple] ./foo
hello world
Lockspace: 0
Segmentation fault (core dumped)


Still feels like I need root somewhere along the way.  OR - my gfs
arrangement is hopelessly misconfigured and I need to be told RTFM.

-Eric




More information about the Linux-cluster mailing list