Skip to contentSkip to conversation

Blocking v/s Non-blocking NFS (and iSCSI) file reads/writes.

DISCUSSION Ben Greear 2 participants 2 messages Sep 7, 2001 – Sep 8, 2001

lore
Share & tools
lore

Ben Greear

author
#0 lore raw

I'm working on writing a program that will be used to stress test NFS and iSCSI based file systems. I am currently using a non-threaded, and non-forking architecture based on non-blocking IO and select() to do my network traffic generation. I would like to be able to fit the file-testing code in the same framework. However, I'm not sure I can make this model work with network based file systems....

So, does select() work for NFS reads? (IE: I open a file-descriptor on an NFS mounted file system, and start reading. The network goes down. Will select() start not marking that file as read/write-able?)

If I set the file descriptor to be O_NONBLOCK, will it return immediately if the network is down (regardless of what select told me)?

I have the same questions about an iSCSI based file system...

Does anyone have any suggestions for reading material on this topic, other than kernel source and patches?

Thanks,
Ben

Signature · 3 lines
Ben Greear <[email protected]>          <[email protected]>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Ben Greear <[email protected]> writes:

> So, does select() work for NFS reads? (IE: I open a > file-descriptor on an NFS mounted file system, and start > reading. The network goes down. Will select() start not > marking that file as read/write-able?)

No.

> If I set the file descriptor to be O_NONBLOCK, will it return > immediately if the network is down (regardless of what select > told me)?

No.

The NFS layer knows nothing at all about the network. It relies on the RPC layer to handle all that for it. There are 2 ways in which it can do this:
1) keep the NFS layer in the dark (using the 'hard' mount option)
2) pass an error back which then propagates back through NFS to the user (the 'soft' mount option).

Cheers,
Trond