|
Home > Archive > Unix Programming > April 2007 > POSIX I/O on NFS with noac option
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
POSIX I/O on NFS with noac option
|
|
| GoogleCMU 2007-04-12, 1:45 pm |
| Trying to get this POSIX I/O code to work on our machines.
Running it from a NFS v3 mounted scratch sapce, with 'noac' option: no
caching attribute option.
It fails to run: gives me err= -1 and errno = 5
Although this works without error on my NFS v3 mounted home
directories. Which are mounted from the head node of our cluster(Linux
based head node and compute nodes).
Where as the scratch sapce is mounted of our storage server(Solaris).
Any idea ?
~thanks - al
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
main()
{
struct flock lock;
int fd, err;
lock.l_type = F_WRLCK;
lock.l_start = 0;
lock.l_whence = SEEK_SET;
lock.l_len = 100;
fd = open("test", O_RDWR | O_CREAT, 0644);
err = fcntl(fd, F_SETLKW, &lock);
printf("err = %d, errno = %d\n", err, errno);
close(fd);
}
| |
| GoogleCMU 2007-04-13, 1:21 pm |
| I found an answer to this problem, from NFS experts.
NFS clients have to be able to access the portmapper, rpc.statd and
rpc.lockd/lockd. To probe this use the following commands on
clients ...
below here ... use -t for TCP mounts and -u for UDP mounts
rpcinfo -t <servername> status
rpcinfo -t <servername> nlockmgr
Mine weren't running ...this basically meant that locking over NFS was
never used by our client apps.
~Cheers ! thanks~
> Trying to get this POSIX I/O code to work on our machines.
>
> Running it from a NFS v3 mounted scratch sapce, with 'noac' option: no
> caching attribute option.
> It fails to run: gives me err= -1 and errno = 5
>
> Although this works without error on my NFS v3 mounted home
> directories. Which are mounted from the head node of our cluster(Linux
> based head node and compute nodes).
> Where as the scratch sapce is mounted of our storage server(Solaris).
>
> Any idea ?
> ~thanks - al
>
> #include <fcntl.h>
> #include <errno.h>
> #include <unistd.h>
>
> main()
> {
> struct flock lock;
> int fd, err;
>
> lock.l_type = F_WRLCK;
> lock.l_start = 0;
> lock.l_whence = SEEK_SET;
> lock.l_len = 100;
>
> fd = open("test", O_RDWR | O_CREAT, 0644);
>
> err = fcntl(fd, F_SETLKW, &lock);
>
> printf("err = %d, errno = %d\n", err, errno);
> close(fd);
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -
|
|
|
|
|