{SQUASHME} layout_get_done errors are nfs_errors not Kernel
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Boaz Harrosh
in
layout_get_donerpc_statusis of type enum nfsstat4 "case" on the correct values.
Sorry, these need to be translated by nfs4_stat_to_errno. We need to add the nfs41 error codes to nfs_errtbl.
By the way, Trond, what do you think of having
two error translation tables in fs/nfs/nfs4xdr.c? One for the basic errors (up to and including NFS4ERR_STALE) and one, adjusted by -10000 for NFS4ERR_BADHANDLE and up. Then, we can use direct lookup using the nfserr (adjusted for high values) rather than linear scan.
I'm not sure if optimizing the error path is worth doing... what do you think?
Benny
Quoted 46 lines
Signed-off-by Boaz Harrosh <[email protected]>--- fs/nfs/pnfs.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-)fs/nfs/pnfs.c +11
-10@@ -974,24 +974,25 @@ pnfs_get_layout_done(struct nfs4_pnfs_layoutget *lgp, int rpc_status)dprintk ("%s: ERROR retrieving layout %d\n" , __func__, rpc_status); -switch (rpc_status) { -case -ENOENT :/* NFS4ERR_BADLAYOUT */ +switch (-rpc_status) { +case NFS4ERR_BADLAYOUT :/* transient error, don't mark with * NFS_INO_LAYOUT_FAILED */ lgp->status =1 ;break ; -case -EAGAIN :/* NFS4ERR_LAYOUTTRYLATER, -* NFS4ERR_RECALLCONFLICT, NFS4ERR_LOCKED -*/ +case NFS4ERR_LAYOUTTRYLATER : +case NFS4ERR_RECALLCONFLICT : +case NFS4ERR_LOCKED : + suspend =get_seconds () +1 ;dprintk ("%s: layout_get suspended until %ld\n" , __func__, suspend);break ; -case -EINVAL :/* NFS4ERR_INVAL, NFSERR_BADIOMODE, -* NFS4ERR_UNKNOWN_LAYOUTTYPE -*/ -case -ENOTSUPP :/* NFS4ERR_LAYOUTUNAVAILABLE */ -case -ETOOSMALL :/* NFS4ERR_TOOSMALL */ +case NFS4ERR_INVAL : +case NFS4ERR_BADIOMODE : +case NFS4ERR_UNKNOWN_LAYOUTTYPE : +case NFS4ERR_LAYOUTUNAVAILABLE : +case NFS4ERR_TOOSMALL :default :/* suspend layout get for ever for this file */ dprintk("%s: no layout_get until %ld\n",