O_NONBLOCK for regular files
Guy,
any opinion on whether we should allow O_NONBLOCK for regular files? XFS currently has this in as a leftover from IRIX, it's used to to allow the HSM support code in XFS (not in the kernel.org code due to the horrible design, just in the oss.sgi.com tree) to return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.
People want to bring that thing over to Linux now which brought thatO_NONBLOCK thing on my radar. I don't see any direct problems with this
thing, but I don't want it as an undocumented XFS extension.
Quoted 11 lines · Christoph Hellwig
Guy,
any opinion on whether we should allow
O_NONBLOCKfor regular files? XFS currently has this in as a leftover from IRIX, it's used to to allow the HSM support code in XFS (not in the kernel.org code due to the horrible design, just in the oss.sgi.com tree) to return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.People want to bring that thing over to Linux now which brought that
O_NONBLOCKthing on my radar. I don't see any direct problems with this
thing, but I don't want it as an undocumented XFS extension.
How do they handle fcntl() (re)setting O_NONBLOCK?
Quoted 1 line · On Thu, Mar 18, 2004 at 08:42:59AM +0000…
How do they handle
fcntl()(re)settingO_NONBLOCK?
The code checks file->f_flags & O_NONBLOCK, so it's exactly the same as for all other uses.
Quoted 10 lines · On Thu, 18 Mar 2004 08:36:28 +0000 Christoph Hellwig <[email protected]> wrote:
any opinion on whether we should allow
O_NONBLOCKfor regular files? XFS currently has this in as a leftover from IRIX, it's used to to allow the HSM support code in XFS (not in the kernel.org code due to the horrible design, just in the oss.sgi.com tree) to return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.People want to bring that thing over to Linux now which brought that
O_NONBLOCKthing on my radar. I don't see any direct problems with this
thing, but I don't want it as an undocumented XFS extension.
We honour O_NONBLOCK when opening files with active leases i.e. the open does not block (returns EWOULDBLOCK), but the lease holder is still notified.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 4 lines · Christoph Hellwig
It's used to to allow the HSM support code in XFS (not in the kernel.org code due to the horrible design, just in the oss.sgi.com tree) to return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.
How does nfsd get notified when the operation is possible? Does poll() work?
If poll works that implies a system call returning EAGAIN triggers at least some part of the HSM operation (whichever part is slow) in the background -- in which case, isn't the existing AIO interface more appropriate?
-- Jamie