POSIX I/O on NFS with noac option - Unix

This is a discussion on POSIX I/O on NFS with noac option - Unix ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: POSIX I/O on NFS with noac option

  1. POSIX I/O on NFS with noac option

    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
    #include
    #include

    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);
    }


  2. Re: POSIX I/O on NFS with noac option

    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 status
    rpcinfo -t 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
    > #include
    > #include
    >
    > 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 -




+ Reply to Thread