From: Benny Halevy <bhalevy@panasas.com>
To: Boaz Harrosh <bharrosh@panasas.com>,
Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: pNFS Mailing List <pnfs@linux-nfs.org>,
NFS list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] {SQUASHME} layout_get_done errors are nfs_errors not Kernel
Date: Tue, 14 Jul 2009 20:41:01 +0300 [thread overview]
Message-ID: <4A5CC32D.3070706@panasas.com> (raw)
In-Reply-To: <4A5CA5D7.4060505@panasas.com>
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",
parent reply other threads:[~2009-07-14 17:41 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <4A5CA5D7.4060505@panasas.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A5CC32D.3070706@panasas.com \
--to=bhalevy@panasas.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bharrosh@panasas.com \
--cc=linux-nfs@vger.kernel.org \
--cc=pnfs@linux-nfs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox