aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-01-04 05:44:16 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:44:16 -0800
commita900aeb7304d8533fb72bab7099e64e469b5ceda (patch)
tree3920f2d3567e9e8b9cbdd36bba3661e145ac95c3 /fs
parentca6b9547f5a09ebd4689c2a5488c6c421dbabbe6 (diff)
downloadhistory-a900aeb7304d8533fb72bab7099e64e469b5ceda.tar.gz
[PATCH] knfsd: nfsd_translate_wouldblocks
-EAGAIN has a special treatment in the nfsd code since it's used to indicate that an upcall has been initiated and that a request should be dropped pending the upcall result. But when the break_lease functions return -EWOULDBLOCK (==-EAGAIN on most architectures), we actually prefer to return nfserr_jukebox. So translate -EAGAIN returns to -ETIMEDOUT (which will be translated to nfserr_jukebox). Undo the mapping of -EWOULDBLOCK to nfserr_jukebox, since on most architectures that has the undesireable effect of mapping -EAGAIN to nfserr_jukebox. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfsproc.c1
-rw-r--r--fs/nfsd/vfs.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 52044f29480e70..70b32eac873cd1 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -586,7 +586,6 @@ nfserrno (int errno)
{ nfserr_dquot, -EDQUOT },
#endif
{ nfserr_stale, -ESTALE },
- { nfserr_jukebox, -EWOULDBLOCK },
{ nfserr_jukebox, -ETIMEDOUT },
{ nfserr_dropit, -EAGAIN },
{ nfserr_dropit, -ENOMEM },
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0949fbd6f838a8..308feda1effce0 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -304,6 +304,8 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
* we need to break all leases.
*/
err = break_lease(inode, FMODE_WRITE | O_NONBLOCK);
+ if (err == -EWOULDBLOCK)
+ err = -ETIMEDOUT;
if (err) /* ENOMEM or EWOULDBLOCK */
goto out_nfserr;
@@ -668,6 +670,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
* This may block while leases are broken.
*/
err = break_lease(inode, O_NONBLOCK | ((access & MAY_WRITE) ? FMODE_WRITE : 0));
+ if (err == -EWOULDBLOCK)
+ err = -ETIMEDOUT;
if (err) /* NOMEM or WOULDBLOCK */
goto out_nfserr;