* Re: [PATCH] {SQUASHME} layout_get_done errors are nfs_errors not Kernel
[not found] <4A5CA5D7.4060505@panasas.com>
@ 2009-07-14 17:41 ` Benny Halevy
0 siblings, 0 replies; only message in thread
From: Benny Halevy @ 2009-07-14 17:41 UTC (permalink / raw)
To: Boaz Harrosh, Trond Myklebust; +Cc: pNFS Mailing List, NFS list
On Jul. 14, 2009, 18:35 +0300, Boaz Harrosh <bharrosh@panasas.com> wrote:
> in layout_get_done rpc_status is 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
>
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
> fs/nfs/pnfs.c | 21 +++++++++++----------
> 1 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index c1b0927..6218f78 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -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",
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-14 17:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4A5CA5D7.4060505@panasas.com>
2009-07-14 17:41 ` [PATCH] {SQUASHME} layout_get_done errors are nfs_errors not Kernel Benny Halevy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox