2011-02-25 17:57:32

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 1/4] NFS remove duplicate clientid in nfs_client

From: Andy Adamson <[email protected]>

Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/nfs4xdr.c | 4 ++--
include/linux/nfs_fs_sb.h | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index c35880c..0f2dcfb 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1664,7 +1664,7 @@ static void encode_create_session(struct xdr_stream *xdr,

p = reserve_space(xdr, 20 + 2*28 + 20 + len + 12);
*p++ = cpu_to_be32(OP_CREATE_SESSION);
- p = xdr_encode_hyper(p, clp->cl_ex_clid);
+ p = xdr_encode_hyper(p, clp->cl_clientid);
*p++ = cpu_to_be32(clp->cl_seqid); /*Sequence id */
*p++ = cpu_to_be32(args->flags); /*flags */

@@ -4699,7 +4699,7 @@ static int decode_exchange_id(struct xdr_stream *xdr,
p = xdr_inline_decode(xdr, 8);
if (unlikely(!p))
goto out_overflow;
- xdr_decode_hyper(p, &clp->cl_ex_clid);
+ xdr_decode_hyper(p, &clp->cl_clientid);
p = xdr_inline_decode(xdr, 12);
if (unlikely(!p))
goto out_overflow;
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 7f71698..e52f010 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -73,8 +73,6 @@ struct nfs_client {
#endif /* CONFIG_NFS_V4 */

#ifdef CONFIG_NFS_V4_1
- /* clientid returned from EXCHANGE_ID, used by session operations */
- u64 cl_ex_clid;
/* The sequence id to use for the next CREATE_SESSION */
u32 cl_seqid;
/* The flags used for obtaining the clientid during EXCHANGE_ID */
--
1.7.3.1



2011-02-27 12:45:11

by Benny Halevy

[permalink] [raw]
Subject: Re: [PATCH 2/4] SQUASHME: NFSv4.1: DS only check

On 2011-02-24 02:11, [email protected] wrote:
> From: Andy Adamson <[email protected]>
>
> squash into fdd1e4e137c75a69a274acc680706906c72344e1
> NFSv4.1: add MDS mount DS only check
>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> fs/nfs/client.c | 10 ++++------
> fs/nfs/nfs4state.c | 2 +-
> 2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 738f624..6dd50ac 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -1400,12 +1400,6 @@ static int nfs4_set_client(struct nfs_server *server,
> goto error;
> }
>
> - /* Cannot mount a DS only server */
> - if (is_ds_only_client(clp)) {
> - error = -ENODEV;
> - goto error;
> - }
> -
> /*
> * Query for the lease time on clientid setup or renewal
> *
> @@ -1500,6 +1494,10 @@ static int nfs4_server_common_setup(struct nfs_server *server,
> BUG_ON(!server->nfs_client->rpc_ops);
> BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
>
> + /* data servers support only a subset of NFSv4.1 */
> + if (is_ds_only_client(server->nfs_client))
> + return -EPROTONOSUPPORT;
> +
> fattr = nfs_alloc_fattr();
> if (fattr == NULL)
> return -ENOMEM;
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 6da026a..0021f40 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -153,7 +153,7 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
> int status;
> struct nfs_fsinfo fsinfo;
>
> - if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) {
> + if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state))

eh? :)

> nfs4_schedule_state_renewal(clp);
> return 0;
> }

2011-02-27 12:44:50

by Benny Halevy

[permalink] [raw]
Subject: Re: [PATCH 3/4] NFSv4.1 reclaim complete must wait for completion

On 2011-02-24 02:11, [email protected] wrote:
> From: Andy Adamson <[email protected]>
>
> Signed-off-by: Andy Adamson <[email protected]>
> Reported-by: Trond Myklebust <[email protected]>
> ---
> fs/nfs/nfs4proc.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 7d80e78..388817b 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -5385,6 +5385,9 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp)
> status = PTR_ERR(task);
> goto out;
> }
> + status = nfs4_wait_for_completion_rpc_task(task);
> + if (status == 0)
> + status = task->tk_status;

nit: please use tabs rather than spaces to indent.

Benny

> rpc_put_task(task);
> return 0;
> out:

2011-02-25 18:03:49

by Fred Isaman

[permalink] [raw]
Subject: Re: [PATCH 2/4] SQUASHME: NFSv4.1: DS only check


On Feb 24, 2011, at 2:11 AM, [email protected] wrote:

> From: Andy Adamson <[email protected]>
>
> squash into fdd1e4e137c75a69a274acc680706906c72344e1
> NFSv4.1: add MDS mount DS only check
>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> fs/nfs/client.c | 10 ++++------
> fs/nfs/nfs4state.c | 2 +-
> 2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 738f624..6dd50ac 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -1400,12 +1400,6 @@ static int nfs4_set_client(struct nfs_server *server,
> goto error;
> }
>
> - /* Cannot mount a DS only server */
> - if (is_ds_only_client(clp)) {
> - error = -ENODEV;
> - goto error;
> - }
> -
> /*
> * Query for the lease time on clientid setup or renewal
> *
> @@ -1500,6 +1494,10 @@ static int nfs4_server_common_setup(struct nfs_server *server,
> BUG_ON(!server->nfs_client->rpc_ops);
> BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
>
> + /* data servers support only a subset of NFSv4.1 */
> + if (is_ds_only_client(server->nfs_client))
> + return -EPROTONOSUPPORT;
> +
> fattr = nfs_alloc_fattr();
> if (fattr == NULL)
> return -ENOMEM;
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 6da026a..0021f40 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -153,7 +153,7 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
> int status;
> struct nfs_fsinfo fsinfo;
>
> - if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) {
> + if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state))
> nfs4_schedule_state_renewal(clp);
> return 0;
> }
> --

This last bit looks suspicious. I'll fix it before adding it to my wave4-cthon branch.

Fred

> 1.7.3.1
>


2011-02-25 17:57:32

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 2/4] SQUASHME: NFSv4.1: DS only check

From: Andy Adamson <[email protected]>

squash into fdd1e4e137c75a69a274acc680706906c72344e1
NFSv4.1: add MDS mount DS only check

Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/client.c | 10 ++++------
fs/nfs/nfs4state.c | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 738f624..6dd50ac 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1400,12 +1400,6 @@ static int nfs4_set_client(struct nfs_server *server,
goto error;
}

- /* Cannot mount a DS only server */
- if (is_ds_only_client(clp)) {
- error = -ENODEV;
- goto error;
- }
-
/*
* Query for the lease time on clientid setup or renewal
*
@@ -1500,6 +1494,10 @@ static int nfs4_server_common_setup(struct nfs_server *server,
BUG_ON(!server->nfs_client->rpc_ops);
BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);

+ /* data servers support only a subset of NFSv4.1 */
+ if (is_ds_only_client(server->nfs_client))
+ return -EPROTONOSUPPORT;
+
fattr = nfs_alloc_fattr();
if (fattr == NULL)
return -ENOMEM;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 6da026a..0021f40 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -153,7 +153,7 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
int status;
struct nfs_fsinfo fsinfo;

- if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) {
+ if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state))
nfs4_schedule_state_renewal(clp);
return 0;
}
--
1.7.3.1


2011-02-25 17:57:32

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 3/4] NFSv4.1 reclaim complete must wait for completion

From: Andy Adamson <[email protected]>

Signed-off-by: Andy Adamson <[email protected]>
Reported-by: Trond Myklebust <[email protected]>
---
fs/nfs/nfs4proc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7d80e78..388817b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5385,6 +5385,9 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp)
status = PTR_ERR(task);
goto out;
}
+ status = nfs4_wait_for_completion_rpc_task(task);
+ if (status == 0)
+ status = task->tk_status;
rpc_put_task(task);
return 0;
out:
--
1.7.3.1


2011-02-25 17:57:34

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 4/4] SQUASHME put_lseg before setting pointer to NULL

From: Andy Adamson <[email protected]>

Signed-off-by: Andy Adamson <[email protected]>
---
fs/nfs/pnfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 58217dd..cbeb873 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -910,8 +910,8 @@ pnfs_try_to_write_data(struct nfs_write_data *wdata,

trypnfs = nfss->pnfs_curr_ld->write_pagelist(wdata, how);
if (trypnfs == PNFS_NOT_ATTEMPTED) {
- wdata->lseg = NULL;
put_lseg(wdata->lseg);
+ wdata->lseg = NULL;
} else
nfs_inc_stats(inode, NFSIOS_PNFS_WRITE);

--
1.7.3.1