Skip to contentSkip to conversation

POSIX I/O on NFS with noac option

DISCUSSION AK 2 participants 5 messages Apr 12, 2007

Subsystems (2)
lore
Share & tools
lore

AK

author
#0 lore raw

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 thoughts on issues related to Solars hosting NFS server and Linux nfs client ..with noac options ???

Any idea ? Appreciate any feedback
~thanks - ak

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

---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 22 lines · AK

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 thoughts on issues related to Solars hosting NFS server and Linux nfs client ..with noac options ???

Any idea ? Appreciate any feedback
~thanks - ak

#include <fcntl.h>
#include <errno.h>
#include <unistd.h>

main()

Quoted 16 lines
{
   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);
}

1) Why would you need the 'noac' flag if you are using locking?

2) Have you checked that the portmapper, rpc.statd and rpc.lockd are accessible from the client? You can probe that using the commands

rpcinfo -t <servername> status
and
rpcinfo -t <servername> nlockmgr

if you are using UDP mounts, you might want to use

rpcinfo -u <servername> status
and
rpcinfo -u <servername> nlockmgr

instead...

Trond

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#2 lore raw

Thank you Trond for your reply ...

Quoted 1 line
Quoted 1 line

1) Why would you need the 'noac' flag if you are using locking?

part of the requirement for MPI-IO to work correctly on NFS mounts.

Quoted 2 lines
Quoted 2 lines

2) Have you checked that the portmapper, rpc.statd and rpc.lockd are accessible from the client? You can probe that using the commands

On Client I have checked that portmap(rpc) rpc.statd(rpcuser) and lockd(root) is running but not rpc.lockd

On server, there is no portmap, rpc.statd, rpc.lock nor lockd running.

Upon the following probes on CLIENT I get the following

Quoted 5 lines
Quoted 5 lines

rpcinfo -t status
and
rpcinfo -t nlockmgr

  # rpcinfo -t <myserver> status
rpcinfo: RPC: Program not registered
program 100024 is not available
  # rpcinfo -t <myserver> nlockmgr
rpcinfo: RPC: Program not registered
program 100021 is not available
Quoted 5 lines
Quoted 5 lines

if you are using UDP mounts, you might want to use

rpcinfo -u status
and
rpcinfo -u nlockmgr

  # rpcinfo -u <myserver> status
rpcinfo: RPC: Program not registered
program 100024 is not available
  # rpcinfo -u <myserver> nlockmgr
rpcinfo: RPC: Program not registered
program 100021 is not available
Quoted 1 line
Quoted 1 line

instead...

Some info from SERVER

  # rpcinfo -u localhost nfs
program 100003 version 2 ready and waiting
program 100003 version 3 ready and waiting
  # rpcinfo -p | grep nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
  # modinfo | egrep "nfs|lock"
 42 7828855a   1d3e  87   1  todds1287 (ds1287 clock driver 1.8)
156 78428000  2b018 106   1  nfs (NFS syscall, client, and common)
156 78428000  2b018 106   1  nfs (NFS syscall, client, and common)
156 78428000  2b018  16   1  nfs (network filesystem)
156 78428000  2b018   7   1  nfs (network filesystem version 2)
156 78428000  2b018  17   1  nfs (network filesystem version 3)
159 78458000  12881   -   1  nfssrv (NFS server module)
Quoted 1 line
Quoted 1 line

Trond

Form the above outputs it doesn't look like they are running. Is this required, if yes, then
how do I turn them ON. And Why didn't we requires it for general purpose NFS use ?? We have been running this server for about 2 years now.

~thanks -ak

---------------------------------
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#3 lore raw
Quoted 4 lines · AK

Thank you Trond for your reply ...

Quoted 1 line
Quoted 1 line

1) Why would you need the 'noac' flag if you are using locking?

part of the requirement for MPI-IO to work correctly on NFS mounts.

Hmm... That sounds extremely dodgy... 'noac' does nothing to ensure cache consistency. All it does is to turn of caching of attributes across system calls.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

2) Have you checked that the portmapper, rpc.statd and rpc.lockd are accessible from the client? You can probe that using the commands

On Client I have checked that portmap(rpc) rpc.statd(rpcuser) and lockd(root) is running but not rpc.lockd

lockd is the kernel process that takes the place of rpc.lockd on Linux machines. It sounds like your client setup is fine.

Quoted 56 lines

On server, there is no portmap, rpc.statd, rpc.lock nor lockd running.

Upon the following probes on CLIENT I get the following

Quoted 5 lines
Quoted 5 lines

rpcinfo -t status
and
rpcinfo -t nlockmgr

# rpcinfo -t <myserver> status
rpcinfo: RPC: Program not registered
program 100024 is not available
# rpcinfo -t <myserver> nlockmgr
rpcinfo: RPC: Program not registered
program 100021 is not available
Quoted 5 lines
Quoted 5 lines

if you are using UDP mounts, you might want to use

rpcinfo -u status
and
rpcinfo -u nlockmgr

# rpcinfo -u <myserver> status
rpcinfo: RPC: Program not registered
program 100024 is not available
# rpcinfo -u <myserver> nlockmgr
rpcinfo: RPC: Program not registered
program 100021 is not available
Quoted 1 line
Quoted 1 line

instead...

Some info from SERVER

# rpcinfo -u localhost nfs
program 100003 version 2 ready and waiting
program 100003 version 3 ready and waiting
# rpcinfo -p | grep nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
# modinfo | egrep "nfs|lock"
 42 7828855a   1d3e  87   1  todds1287 (ds1287 clock driver 1.8)
156 78428000  2b018 106   1  nfs (NFS syscall, client, and common)
156 78428000  2b018 106   1  nfs (NFS syscall, client, and common)
156 78428000  2b018  16   1  nfs (network filesystem)
156 78428000  2b018   7   1  nfs (network filesystem version 2)
156 78428000  2b018  17   1  nfs (network filesystem version 3)
159 78458000  12881   -   1  nfssrv (NFS server module)
Quoted 6 lines
Quoted 1 line
Quoted 1 line

Trond

Form the above outputs it doesn't look like they are running. Is this required, if yes, then
how do I turn them ON. And Why didn't we requires it for general purpose NFS use ?? We have been running this server for about 2 years now.

If it has been running for 2 years, then I'd say you clearly haven't been using locking over NFS against it.

Check your Solaris admin manual for details on how to turn on the locking manager and lock status daemon.

Cheers
Trond

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#4 lore raw

If it has been running for 2 years, then I'd say you clearly haven't been using locking over NFS against it.

Check your Solaris admin manual for details on how to turn on the locking manager and lock status daemon.

Cheers
Trond

~ thanks Trond, will try that and get back!!! -al

---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs