Skip to contentSkip to conversation

NFS remove duplicate clientid in nfs_client

PATCH In review [email protected] 3 participants 7 messages Feb 25, 2011 – Feb 27, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 NFS remove duplicate clientid in nfs_client

From: Andy Adamson <[email protected]>

---
 fs/nfs/nfs4xdr.c          |    4 ++--
 include/linux/nfs_fs_sb.h |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
fs/nfs/nfs4xdr.c +2 -2
index c35880c..0f2dcfb 100644
@@ -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;
include/linux/nfs_fs_sb.h +0 -2
index 7f71698..e52f010 100644
@@ -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 */
Signature · 1 line
1.7.3.1
#1 lore raw

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

---
 fs/nfs/client.c    |   10 ++++------
 fs/nfs/nfs4state.c |    2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
fs/nfs/client.c +4 -6
index 738f624..6dd50ac 100644
@@ -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;
fs/nfs/nfs4state.c +1 -1
index 6da026a..0021f40 100644
@@ -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;
 	}
Signature · 1 line
1.7.3.1
#2 lore raw

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

Quoted 45 lines · 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

---
fs/nfs/client.c | 10 ++++------
fs/nfs/nfs4state.c | 2 +-

2 files changed, 5 insertions(+), 7 deletions(-)
fs/nfs/client.c +4 -6
index 738f624..6dd50ac 100644
@@ -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;
fs/nfs/nfs4state.c +0 -0
index 6da026a..0021f40 100644

fs/nfs/nfs4state.c static int nfs41_setup_state_renewal(struct nfs_client *clp) · line 159

Quoted 8 lines
fs/nfs/nfs4state.c +1 -1
@@ -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

Quoted 2 lines

1.7.3.1

#3 lore raw

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

In reply to [email protected]
Quoted 44 lines · 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

---
 fs/nfs/client.c    |   10 ++++------
 fs/nfs/nfs4state.c |    2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
fs/nfs/client.c +4 -6
index 738f624..6dd50ac 100644
@@ -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;
fs/nfs/nfs4state.c +0 -0
index 6da026a..0021f40 100644

fs/nfs/nfs4state.c static int nfs41_setup_state_renewal(struct nfs_client *clp) · line 156

Quoted 5 lines
fs/nfs/nfs4state.c +1 -1
@@ -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? :)

Quoted 3 lines
fs/nfs/nfs4state.c +0 -0
 		nfs4_schedule_state_renewal(clp);
 		return 0;
 	}
#4 lore raw

PATCH 3/4 NFSv4.1 reclaim complete must wait for completion

In reply to [email protected]

From: Andy Adamson <[email protected]>

---
 fs/nfs/nfs4proc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +3 -0
index 7d80e78..388817b 100644
@@ -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:
Signature · 1 line
1.7.3.1
#5 lore raw

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

Quoted 13 lines · On 2011-02-24 02:11, [email protected] wrote:

From: Andy Adamson <[email protected]>

---
 fs/nfs/nfs4proc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +0 -0
index 7d80e78..388817b 100644

fs/nfs/nfs4proc.c static int nfs41_proc_reclaim_complete(struct nfs_client *clp) · line 5390

Quoted 6 lines
fs/nfs/nfs4proc.c +3 -0
@@ -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

Quoted 3 lines
fs/nfs/nfs4proc.c +0 -0
 	rpc_put_task(task);
 	return 0;
 out:
#6 lore raw

PATCH 4/4 SQUASHME put_lseg before setting pointer to NULL

In reply to [email protected]

From: Andy Adamson <[email protected]>

---
 fs/nfs/pnfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/pnfs.c +1 -1
index 58217dd..cbeb873 100644
@@ -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);
 
Signature · 1 line
1.7.3.1