2001-12-04 00:21:09

by Chris Friesen

[permalink] [raw]
Subject: possible to do non-blocking write to NFS?


Is there any way to write to an NFS-mounted filesystem in a way that will avoid
all of the NFS retries? Basically I want to try a write, and if the server is
not accessable I want to return immediately with an error code.

Would setting the O_NONBLOCK flag on opening the file give me this behaviour?

Chris




--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: [email protected]


2001-12-04 00:46:50

by James Stevenson

[permalink] [raw]
Subject: Re: possible to do non-blocking write to NFS?


> Is there any way to write to an NFS-mounted filesystem in a way that will
avoid
> all of the NFS retries? Basically I want to try a write, and if the
server is
> not accessable I want to return immediately with an error code.

see the mount options for nfs
under the mount and nfs man pages

> Would setting the O_NONBLOCK flag on opening the file give me this
behaviour?
>

no it would not

James


2001-12-04 09:21:55

by Alan

[permalink] [raw]
Subject: Re: possible to do non-blocking write to NFS?

> Is there any way to write to an NFS-mounted filesystem in a way that will avoid
> all of the NFS retries? Basically I want to try a write, and if the server is
> not accessable I want to return immediately with an error code.

Mount the file system soft. Remember that the error you see may well be on
fsync or close. Also it'll still take some time to decide the other end is
dead not just slow

Alan