I found these nits on the wayward journey to implementing client-side
migration support.
---
Chuck Lever (3):
NFS: Remove no-op less-than-zero checks on unsigned variables.
NFS: Clean up nfs4_xdr_dec_secinfo()
NFS: Fix documenting comment for nfs_create_request()
fs/nfs/nfs4filelayout.c | 7 +++----
fs/nfs/nfs4xdr.c | 2 --
fs/nfs/pagelist.c | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
--
Chuck Lever
Introduced by commit 16b374ca "NFSv4.1: pnfs: filelayout: add driver's
LAYOUTGET and GETDEVICEINFO infrastructure" (October 20, 2010).
Signed-off-by: Chuck Lever <[email protected]>
---
fs/nfs/nfs4filelayout.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index e8915d4..bbc5a21 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -468,9 +468,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
fl->dsaddr = dsaddr;
- if (fl->first_stripe_index < 0 ||
- fl->first_stripe_index >= dsaddr->stripe_count) {
- dprintk("%s Bad first_stripe_index %d\n",
+ if (fl->first_stripe_index >= dsaddr->stripe_count) {
+ dprintk("%s Bad first_stripe_index %u\n",
__func__, fl->first_stripe_index);
goto out_put;
}
@@ -571,7 +570,7 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
/* Note that a zero value for num_fh is legal for STRIPE_SPARSE.
* Futher checking is done in filelayout_check_layout */
- if (fl->num_fh < 0 || fl->num_fh >
+ if (fl->num_fh >
max(NFS4_PNFS_MAX_STRIPE_CNT, NFS4_PNFS_MAX_MULTI_CNT))
goto out_err;
Clean up: the first parameter of nfs_create_request() has been
incorrectly documented since time immemorial (OK, since before
2.6.12).
Signed-off-by: Chuck Lever <[email protected]>
---
fs/nfs/pagelist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index b60970c..0a5ff5c 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -41,7 +41,7 @@ nfs_page_free(struct nfs_page *p)
/**
* nfs_create_request - Create an NFS read/write request.
- * @file: file descriptor to use
+ * @ctx: open context to use
* @inode: inode to which the request is attached
* @page: page to write
* @offset: starting offset within the page for the write
Clean up: Remove superfluous logic at the tail of
nfs4_xdr_dec_secinfo() .
Introduced by commit 5a5ea0d4 "NFS: Add secinfo procedure" (March 24,
2011).
Signed-off-by: Chuck Lever <[email protected]>
---
fs/nfs/nfs4xdr.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 1dce12f..e6161b2 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -6602,8 +6602,6 @@ static int nfs4_xdr_dec_secinfo(struct rpc_rqst *rqstp,
if (status)
goto out;
status = decode_secinfo(xdr, res);
- if (status)
- goto out;
out:
return status;
}
On 10/25/2011 12:17 PM, Chuck Lever wrote:
> Clean up: Remove superfluous logic at the tail of
> nfs4_xdr_dec_secinfo() .
Oops. Good catch!
- Bryan
>
> Introduced by commit 5a5ea0d4 "NFS: Add secinfo procedure" (March 24,
> 2011).
>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
>
> fs/nfs/nfs4xdr.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
> index 1dce12f..e6161b2 100644
> --- a/fs/nfs/nfs4xdr.c
> +++ b/fs/nfs/nfs4xdr.c
> @@ -6602,8 +6602,6 @@ static int nfs4_xdr_dec_secinfo(struct rpc_rqst *rqstp,
> if (status)
> goto out;
> status = decode_secinfo(xdr, res);
> - if (status)
> - goto out;
> out:
> return status;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html