diff options
-rw-r--r-- | fs/nfs/callback_xdr.c | 8 | ||||
-rw-r--r-- | fs/nfs/client.c | 2 | ||||
-rw-r--r-- | fs/nfs/direct.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 42 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 22 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 15 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 2 | ||||
-rw-r--r-- | fs/nfs/proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/super.c | 3 | ||||
-rw-r--r-- | fs/nfs/write.c | 7 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 3 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 12 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 3 |
14 files changed, 85 insertions, 46 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 95bfc243992c..e64b01d2a338 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -455,9 +455,9 @@ static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp, | |||
455 | args->csa_nrclists = ntohl(*p++); | 455 | args->csa_nrclists = ntohl(*p++); |
456 | args->csa_rclists = NULL; | 456 | args->csa_rclists = NULL; |
457 | if (args->csa_nrclists) { | 457 | if (args->csa_nrclists) { |
458 | args->csa_rclists = kmalloc(args->csa_nrclists * | 458 | args->csa_rclists = kmalloc_array(args->csa_nrclists, |
459 | sizeof(*args->csa_rclists), | 459 | sizeof(*args->csa_rclists), |
460 | GFP_KERNEL); | 460 | GFP_KERNEL); |
461 | if (unlikely(args->csa_rclists == NULL)) | 461 | if (unlikely(args->csa_rclists == NULL)) |
462 | goto out; | 462 | goto out; |
463 | 463 | ||
@@ -696,7 +696,7 @@ static __be32 encode_cb_sequence_res(struct svc_rqst *rqstp, | |||
696 | const struct cb_sequenceres *res) | 696 | const struct cb_sequenceres *res) |
697 | { | 697 | { |
698 | __be32 *p; | 698 | __be32 *p; |
699 | unsigned status = res->csr_status; | 699 | __be32 status = res->csr_status; |
700 | 700 | ||
701 | if (unlikely(status != 0)) | 701 | if (unlikely(status != 0)) |
702 | goto out; | 702 | goto out; |
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 7d108753af81..17ba6b995659 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -544,8 +544,6 @@ nfs_found_client(const struct nfs_client_initdata *cl_init, | |||
544 | 544 | ||
545 | smp_rmb(); | 545 | smp_rmb(); |
546 | 546 | ||
547 | BUG_ON(clp->cl_cons_state != NFS_CS_READY); | ||
548 | |||
549 | dprintk("<-- %s found nfs_client %p for %s\n", | 547 | dprintk("<-- %s found nfs_client %p for %s\n", |
550 | __func__, clp, cl_init->hostname ?: ""); | 548 | __func__, clp, cl_init->hostname ?: ""); |
551 | return clp; | 549 | return clp; |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index ad2775d3e219..3168f6e3d4d4 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -523,9 +523,9 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data) | |||
523 | nfs_list_remove_request(req); | 523 | nfs_list_remove_request(req); |
524 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { | 524 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { |
525 | /* Note the rewrite will go through mds */ | 525 | /* Note the rewrite will go through mds */ |
526 | kref_get(&req->wb_kref); | ||
527 | nfs_mark_request_commit(req, NULL, &cinfo); | 526 | nfs_mark_request_commit(req, NULL, &cinfo); |
528 | } | 527 | } else |
528 | nfs_release_request(req); | ||
529 | nfs_unlock_and_release_request(req); | 529 | nfs_unlock_and_release_request(req); |
530 | } | 530 | } |
531 | 531 | ||
@@ -716,12 +716,12 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr) | |||
716 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) | 716 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) |
717 | bit = NFS_IOHDR_NEED_RESCHED; | 717 | bit = NFS_IOHDR_NEED_RESCHED; |
718 | else if (dreq->flags == 0) { | 718 | else if (dreq->flags == 0) { |
719 | memcpy(&dreq->verf, &req->wb_verf, | 719 | memcpy(&dreq->verf, hdr->verf, |
720 | sizeof(dreq->verf)); | 720 | sizeof(dreq->verf)); |
721 | bit = NFS_IOHDR_NEED_COMMIT; | 721 | bit = NFS_IOHDR_NEED_COMMIT; |
722 | dreq->flags = NFS_ODIRECT_DO_COMMIT; | 722 | dreq->flags = NFS_ODIRECT_DO_COMMIT; |
723 | } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) { | 723 | } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) { |
724 | if (memcmp(&dreq->verf, &req->wb_verf, sizeof(dreq->verf))) { | 724 | if (memcmp(&dreq->verf, hdr->verf, sizeof(dreq->verf))) { |
725 | dreq->flags = NFS_ODIRECT_RESCHED_WRITES; | 725 | dreq->flags = NFS_ODIRECT_RESCHED_WRITES; |
726 | bit = NFS_IOHDR_NEED_RESCHED; | 726 | bit = NFS_IOHDR_NEED_RESCHED; |
727 | } else | 727 | } else |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index c6827f93ab57..cc5900ac61b5 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -295,7 +295,7 @@ is_ds_client(struct nfs_client *clp) | |||
295 | 295 | ||
296 | extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; | 296 | extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; |
297 | 297 | ||
298 | extern const u32 nfs4_fattr_bitmap[2]; | 298 | extern const u32 nfs4_fattr_bitmap[3]; |
299 | extern const u32 nfs4_statfs_bitmap[2]; | 299 | extern const u32 nfs4_statfs_bitmap[2]; |
300 | extern const u32 nfs4_pathconf_bitmap[2]; | 300 | extern const u32 nfs4_pathconf_bitmap[2]; |
301 | extern const u32 nfs4_fsinfo_bitmap[3]; | 301 | extern const u32 nfs4_fsinfo_bitmap[3]; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d48dbefa0e71..15fc7e4664ed 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -105,6 +105,8 @@ static int nfs4_map_errors(int err) | |||
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | case -NFS4ERR_SHARE_DENIED: | 106 | case -NFS4ERR_SHARE_DENIED: |
107 | return -EACCES; | 107 | return -EACCES; |
108 | case -NFS4ERR_MINOR_VERS_MISMATCH: | ||
109 | return -EPROTONOSUPPORT; | ||
108 | default: | 110 | default: |
109 | dprintk("%s could not handle NFSv4 error %d\n", | 111 | dprintk("%s could not handle NFSv4 error %d\n", |
110 | __func__, -err); | 112 | __func__, -err); |
@@ -116,7 +118,7 @@ static int nfs4_map_errors(int err) | |||
116 | /* | 118 | /* |
117 | * This is our standard bitmap for GETATTR requests. | 119 | * This is our standard bitmap for GETATTR requests. |
118 | */ | 120 | */ |
119 | const u32 nfs4_fattr_bitmap[2] = { | 121 | const u32 nfs4_fattr_bitmap[3] = { |
120 | FATTR4_WORD0_TYPE | 122 | FATTR4_WORD0_TYPE |
121 | | FATTR4_WORD0_CHANGE | 123 | | FATTR4_WORD0_CHANGE |
122 | | FATTR4_WORD0_SIZE | 124 | | FATTR4_WORD0_SIZE |
@@ -133,6 +135,24 @@ const u32 nfs4_fattr_bitmap[2] = { | |||
133 | | FATTR4_WORD1_TIME_MODIFY | 135 | | FATTR4_WORD1_TIME_MODIFY |
134 | }; | 136 | }; |
135 | 137 | ||
138 | static const u32 nfs4_pnfs_open_bitmap[3] = { | ||
139 | FATTR4_WORD0_TYPE | ||
140 | | FATTR4_WORD0_CHANGE | ||
141 | | FATTR4_WORD0_SIZE | ||
142 | | FATTR4_WORD0_FSID | ||
143 | | FATTR4_WORD0_FILEID, | ||
144 | FATTR4_WORD1_MODE | ||
145 | | FATTR4_WORD1_NUMLINKS | ||
146 | | FATTR4_WORD1_OWNER | ||
147 | | FATTR4_WORD1_OWNER_GROUP | ||
148 | | FATTR4_WORD1_RAWDEV | ||
149 | | FATTR4_WORD1_SPACE_USED | ||
150 | | FATTR4_WORD1_TIME_ACCESS | ||
151 | | FATTR4_WORD1_TIME_METADATA | ||
152 | | FATTR4_WORD1_TIME_MODIFY, | ||
153 | FATTR4_WORD2_MDSTHRESHOLD | ||
154 | }; | ||
155 | |||
136 | const u32 nfs4_statfs_bitmap[2] = { | 156 | const u32 nfs4_statfs_bitmap[2] = { |
137 | FATTR4_WORD0_FILES_AVAIL | 157 | FATTR4_WORD0_FILES_AVAIL |
138 | | FATTR4_WORD0_FILES_FREE | 158 | | FATTR4_WORD0_FILES_FREE |
@@ -844,6 +864,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, | |||
844 | p->o_arg.name = &dentry->d_name; | 864 | p->o_arg.name = &dentry->d_name; |
845 | p->o_arg.server = server; | 865 | p->o_arg.server = server; |
846 | p->o_arg.bitmask = server->attr_bitmask; | 866 | p->o_arg.bitmask = server->attr_bitmask; |
867 | p->o_arg.open_bitmap = &nfs4_fattr_bitmap[0]; | ||
847 | p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; | 868 | p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; |
848 | if (attrs != NULL && attrs->ia_valid != 0) { | 869 | if (attrs != NULL && attrs->ia_valid != 0) { |
849 | __be32 verf[2]; | 870 | __be32 verf[2]; |
@@ -1820,6 +1841,7 @@ static int _nfs4_do_open(struct inode *dir, | |||
1820 | opendata->f_attr.mdsthreshold = pnfs_mdsthreshold_alloc(); | 1841 | opendata->f_attr.mdsthreshold = pnfs_mdsthreshold_alloc(); |
1821 | if (!opendata->f_attr.mdsthreshold) | 1842 | if (!opendata->f_attr.mdsthreshold) |
1822 | goto err_opendata_put; | 1843 | goto err_opendata_put; |
1844 | opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0]; | ||
1823 | } | 1845 | } |
1824 | if (dentry->d_inode != NULL) | 1846 | if (dentry->d_inode != NULL) |
1825 | opendata->state = nfs4_get_open_state(dentry->d_inode, sp); | 1847 | opendata->state = nfs4_get_open_state(dentry->d_inode, sp); |
@@ -1880,6 +1902,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, | |||
1880 | struct nfs4_state *res; | 1902 | struct nfs4_state *res; |
1881 | int status; | 1903 | int status; |
1882 | 1904 | ||
1905 | fmode &= FMODE_READ|FMODE_WRITE; | ||
1883 | do { | 1906 | do { |
1884 | status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, cred, | 1907 | status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, cred, |
1885 | &res, ctx_th); | 1908 | &res, ctx_th); |
@@ -2526,6 +2549,14 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
2526 | 2549 | ||
2527 | nfs_fattr_init(fattr); | 2550 | nfs_fattr_init(fattr); |
2528 | 2551 | ||
2552 | /* Deal with open(O_TRUNC) */ | ||
2553 | if (sattr->ia_valid & ATTR_OPEN) | ||
2554 | sattr->ia_valid &= ~(ATTR_MTIME|ATTR_CTIME|ATTR_OPEN); | ||
2555 | |||
2556 | /* Optimization: if the end result is no change, don't RPC */ | ||
2557 | if ((sattr->ia_valid & ~(ATTR_FILE)) == 0) | ||
2558 | return 0; | ||
2559 | |||
2529 | /* Search for an existing open(O_WRITE) file */ | 2560 | /* Search for an existing open(O_WRITE) file */ |
2530 | if (sattr->ia_valid & ATTR_FILE) { | 2561 | if (sattr->ia_valid & ATTR_FILE) { |
2531 | struct nfs_open_context *ctx; | 2562 | struct nfs_open_context *ctx; |
@@ -2537,10 +2568,6 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
2537 | } | 2568 | } |
2538 | } | 2569 | } |
2539 | 2570 | ||
2540 | /* Deal with open(O_TRUNC) */ | ||
2541 | if (sattr->ia_valid & ATTR_OPEN) | ||
2542 | sattr->ia_valid &= ~(ATTR_MTIME|ATTR_CTIME|ATTR_OPEN); | ||
2543 | |||
2544 | status = nfs4_do_setattr(inode, cred, fattr, sattr, state); | 2571 | status = nfs4_do_setattr(inode, cred, fattr, sattr, state); |
2545 | if (status == 0) | 2572 | if (status == 0) |
2546 | nfs_setattr_update_inode(inode, sattr); | 2573 | nfs_setattr_update_inode(inode, sattr); |
@@ -5275,7 +5302,7 @@ static int _nfs4_proc_destroy_clientid(struct nfs_client *clp, | |||
5275 | 5302 | ||
5276 | status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); | 5303 | status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); |
5277 | if (status) | 5304 | if (status) |
5278 | pr_warn("NFS: Got error %d from the server %s on " | 5305 | dprintk("NFS: Got error %d from the server %s on " |
5279 | "DESTROY_CLIENTID.", status, clp->cl_hostname); | 5306 | "DESTROY_CLIENTID.", status, clp->cl_hostname); |
5280 | return status; | 5307 | return status; |
5281 | } | 5308 | } |
@@ -5746,8 +5773,7 @@ int nfs4_proc_destroy_session(struct nfs4_session *session, | |||
5746 | status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); | 5773 | status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); |
5747 | 5774 | ||
5748 | if (status) | 5775 | if (status) |
5749 | printk(KERN_WARNING | 5776 | dprintk("NFS: Got error %d from the server on DESTROY_SESSION. " |
5750 | "NFS: Got error %d from the server on DESTROY_SESSION. " | ||
5751 | "Session has been destroyed regardless...\n", status); | 5777 | "Session has been destroyed regardless...\n", status); |
5752 | 5778 | ||
5753 | dprintk("<-- nfs4_proc_destroy_session\n"); | 5779 | dprintk("<-- nfs4_proc_destroy_session\n"); |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index c679b9ecef63..f38300e9f171 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -244,6 +244,16 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) | |||
244 | return nfs4_wait_on_slot_tbl(&ses->fc_slot_table); | 244 | return nfs4_wait_on_slot_tbl(&ses->fc_slot_table); |
245 | } | 245 | } |
246 | 246 | ||
247 | static void nfs41_finish_session_reset(struct nfs_client *clp) | ||
248 | { | ||
249 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | ||
250 | clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); | ||
251 | /* create_session negotiated new slot table */ | ||
252 | clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); | ||
253 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); | ||
254 | nfs41_setup_state_renewal(clp); | ||
255 | } | ||
256 | |||
247 | int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred) | 257 | int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred) |
248 | { | 258 | { |
249 | int status; | 259 | int status; |
@@ -259,8 +269,7 @@ do_confirm: | |||
259 | status = nfs4_proc_create_session(clp, cred); | 269 | status = nfs4_proc_create_session(clp, cred); |
260 | if (status != 0) | 270 | if (status != 0) |
261 | goto out; | 271 | goto out; |
262 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | 272 | nfs41_finish_session_reset(clp); |
263 | nfs41_setup_state_renewal(clp); | ||
264 | nfs_mark_client_ready(clp, NFS_CS_READY); | 273 | nfs_mark_client_ready(clp, NFS_CS_READY); |
265 | out: | 274 | out: |
266 | return status; | 275 | return status; |
@@ -1772,16 +1781,9 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1772 | status = nfs4_handle_reclaim_lease_error(clp, status); | 1781 | status = nfs4_handle_reclaim_lease_error(clp, status); |
1773 | goto out; | 1782 | goto out; |
1774 | } | 1783 | } |
1775 | clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); | 1784 | nfs41_finish_session_reset(clp); |
1776 | /* create_session negotiated new slot table */ | ||
1777 | clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); | ||
1778 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); | ||
1779 | dprintk("%s: session reset was successful for server %s!\n", | 1785 | dprintk("%s: session reset was successful for server %s!\n", |
1780 | __func__, clp->cl_hostname); | 1786 | __func__, clp->cl_hostname); |
1781 | |||
1782 | /* Let the state manager reestablish state */ | ||
1783 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | ||
1784 | nfs41_setup_state_renewal(clp); | ||
1785 | out: | 1787 | out: |
1786 | if (cred) | 1788 | if (cred) |
1787 | put_rpccred(cred); | 1789 | put_rpccred(cred); |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index ee4a74db95d0..18fae29b0301 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1198,12 +1198,13 @@ static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct c | |||
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask, | 1200 | static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask, |
1201 | const u32 *open_bitmap, | ||
1201 | struct compound_hdr *hdr) | 1202 | struct compound_hdr *hdr) |
1202 | { | 1203 | { |
1203 | encode_getattr_three(xdr, | 1204 | encode_getattr_three(xdr, |
1204 | bitmask[0] & nfs4_fattr_bitmap[0], | 1205 | bitmask[0] & open_bitmap[0], |
1205 | bitmask[1] & nfs4_fattr_bitmap[1], | 1206 | bitmask[1] & open_bitmap[1], |
1206 | bitmask[2] & FATTR4_WORD2_MDSTHRESHOLD, | 1207 | bitmask[2] & open_bitmap[2], |
1207 | hdr); | 1208 | hdr); |
1208 | } | 1209 | } |
1209 | 1210 | ||
@@ -2221,7 +2222,7 @@ static void nfs4_xdr_enc_open(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2221 | encode_putfh(xdr, args->fh, &hdr); | 2222 | encode_putfh(xdr, args->fh, &hdr); |
2222 | encode_open(xdr, args, &hdr); | 2223 | encode_open(xdr, args, &hdr); |
2223 | encode_getfh(xdr, &hdr); | 2224 | encode_getfh(xdr, &hdr); |
2224 | encode_getfattr_open(xdr, args->bitmask, &hdr); | 2225 | encode_getfattr_open(xdr, args->bitmask, args->open_bitmap, &hdr); |
2225 | encode_nops(&hdr); | 2226 | encode_nops(&hdr); |
2226 | } | 2227 | } |
2227 | 2228 | ||
@@ -4359,7 +4360,10 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
4359 | 4360 | ||
4360 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) | 4361 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) |
4361 | return -EIO; | 4362 | return -EIO; |
4362 | if (likely(bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD)) { | 4363 | if (bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD) { |
4364 | /* Did the server return an unrequested attribute? */ | ||
4365 | if (unlikely(res == NULL)) | ||
4366 | return -EREMOTEIO; | ||
4363 | p = xdr_inline_decode(xdr, 4); | 4367 | p = xdr_inline_decode(xdr, 4); |
4364 | if (unlikely(!p)) | 4368 | if (unlikely(!p)) |
4365 | goto out_overflow; | 4369 | goto out_overflow; |
@@ -4372,6 +4376,7 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
4372 | __func__); | 4376 | __func__); |
4373 | 4377 | ||
4374 | status = decode_first_threshold_item4(xdr, res); | 4378 | status = decode_first_threshold_item4(xdr, res); |
4379 | bitmap[2] &= ~FATTR4_WORD2_MDSTHRESHOLD; | ||
4375 | } | 4380 | } |
4376 | return status; | 4381 | return status; |
4377 | out_overflow: | 4382 | out_overflow: |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 29fd23c0efdc..64f90d845f6a 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -365,7 +365,7 @@ static inline bool | |||
365 | pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src, | 365 | pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src, |
366 | struct nfs_server *nfss) | 366 | struct nfs_server *nfss) |
367 | { | 367 | { |
368 | return (dst && src && src->bm != 0 && | 368 | return (dst && src && src->bm != 0 && nfss->pnfs_curr_ld && |
369 | nfss->pnfs_curr_ld->id == src->l_type); | 369 | nfss->pnfs_curr_ld->id == src->l_type); |
370 | } | 370 | } |
371 | 371 | ||
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index a706b6bcc286..617c7419a08e 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -651,7 +651,7 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data) | |||
651 | /* Emulate the eof flag, which isn't normally needed in NFSv2 | 651 | /* Emulate the eof flag, which isn't normally needed in NFSv2 |
652 | * as it is guaranteed to always return the file attributes | 652 | * as it is guaranteed to always return the file attributes |
653 | */ | 653 | */ |
654 | if (data->args.offset + data->args.count >= data->res.fattr->size) | 654 | if (data->args.offset + data->res.count >= data->res.fattr->size) |
655 | data->res.eof = 1; | 655 | data->res.eof = 1; |
656 | } | 656 | } |
657 | return 0; | 657 | return 0; |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index ff656c022684..906f09c7d842 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options, | |||
1867 | if (data == NULL) | 1867 | if (data == NULL) |
1868 | goto out_no_data; | 1868 | goto out_no_data; |
1869 | 1869 | ||
1870 | args->version = NFS_DEFAULT_VERSION; | ||
1870 | switch (data->version) { | 1871 | switch (data->version) { |
1871 | case 1: | 1872 | case 1: |
1872 | data->namlen = 0; | 1873 | data->namlen = 0; |
@@ -2637,6 +2638,8 @@ static int nfs4_validate_mount_data(void *options, | |||
2637 | if (data == NULL) | 2638 | if (data == NULL) |
2638 | goto out_no_data; | 2639 | goto out_no_data; |
2639 | 2640 | ||
2641 | args->version = 4; | ||
2642 | |||
2640 | switch (data->version) { | 2643 | switch (data->version) { |
2641 | case 1: | 2644 | case 1: |
2642 | if (data->host_addrlen > sizeof(args->nfs_server.address)) | 2645 | if (data->host_addrlen > sizeof(args->nfs_server.address)) |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e6fe3d69d14c..4d6861c0dc14 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -80,6 +80,7 @@ struct nfs_write_header *nfs_writehdr_alloc(void) | |||
80 | INIT_LIST_HEAD(&hdr->rpc_list); | 80 | INIT_LIST_HEAD(&hdr->rpc_list); |
81 | spin_lock_init(&hdr->lock); | 81 | spin_lock_init(&hdr->lock); |
82 | atomic_set(&hdr->refcnt, 0); | 82 | atomic_set(&hdr->refcnt, 0); |
83 | hdr->verf = &p->verf; | ||
83 | } | 84 | } |
84 | return p; | 85 | return p; |
85 | } | 86 | } |
@@ -619,6 +620,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) | |||
619 | goto next; | 620 | goto next; |
620 | } | 621 | } |
621 | if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) { | 622 | if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) { |
623 | memcpy(&req->wb_verf, hdr->verf, sizeof(req->wb_verf)); | ||
622 | nfs_mark_request_commit(req, hdr->lseg, &cinfo); | 624 | nfs_mark_request_commit(req, hdr->lseg, &cinfo); |
623 | goto next; | 625 | goto next; |
624 | } | 626 | } |
@@ -1255,15 +1257,14 @@ static void nfs_writeback_release_common(void *calldata) | |||
1255 | struct nfs_write_data *data = calldata; | 1257 | struct nfs_write_data *data = calldata; |
1256 | struct nfs_pgio_header *hdr = data->header; | 1258 | struct nfs_pgio_header *hdr = data->header; |
1257 | int status = data->task.tk_status; | 1259 | int status = data->task.tk_status; |
1258 | struct nfs_page *req = hdr->req; | ||
1259 | 1260 | ||
1260 | if ((status >= 0) && nfs_write_need_commit(data)) { | 1261 | if ((status >= 0) && nfs_write_need_commit(data)) { |
1261 | spin_lock(&hdr->lock); | 1262 | spin_lock(&hdr->lock); |
1262 | if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags)) | 1263 | if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags)) |
1263 | ; /* Do nothing */ | 1264 | ; /* Do nothing */ |
1264 | else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) | 1265 | else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) |
1265 | memcpy(&req->wb_verf, &data->verf, sizeof(req->wb_verf)); | 1266 | memcpy(hdr->verf, &data->verf, sizeof(*hdr->verf)); |
1266 | else if (memcmp(&req->wb_verf, &data->verf, sizeof(req->wb_verf))) | 1267 | else if (memcmp(hdr->verf, &data->verf, sizeof(*hdr->verf))) |
1267 | set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags); | 1268 | set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags); |
1268 | spin_unlock(&hdr->lock); | 1269 | spin_unlock(&hdr->lock); |
1269 | } | 1270 | } |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index d1a7bf51c326..8aadd90b808a 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -348,6 +348,7 @@ struct nfs_openargs { | |||
348 | const struct qstr * name; | 348 | const struct qstr * name; |
349 | const struct nfs_server *server; /* Needed for ID mapping */ | 349 | const struct nfs_server *server; /* Needed for ID mapping */ |
350 | const u32 * bitmask; | 350 | const u32 * bitmask; |
351 | const u32 * open_bitmap; | ||
351 | __u32 claim; | 352 | __u32 claim; |
352 | struct nfs4_sequence_args seq_args; | 353 | struct nfs4_sequence_args seq_args; |
353 | }; | 354 | }; |
@@ -1236,6 +1237,7 @@ struct nfs_pgio_header { | |||
1236 | struct list_head rpc_list; | 1237 | struct list_head rpc_list; |
1237 | atomic_t refcnt; | 1238 | atomic_t refcnt; |
1238 | struct nfs_page *req; | 1239 | struct nfs_page *req; |
1240 | struct nfs_writeverf *verf; | ||
1239 | struct pnfs_layout_segment *lseg; | 1241 | struct pnfs_layout_segment *lseg; |
1240 | loff_t io_start; | 1242 | loff_t io_start; |
1241 | const struct rpc_call_ops *mds_ops; | 1243 | const struct rpc_call_ops *mds_ops; |
@@ -1273,6 +1275,7 @@ struct nfs_write_data { | |||
1273 | struct nfs_write_header { | 1275 | struct nfs_write_header { |
1274 | struct nfs_pgio_header header; | 1276 | struct nfs_pgio_header header; |
1275 | struct nfs_write_data rpc_data; | 1277 | struct nfs_write_data rpc_data; |
1278 | struct nfs_writeverf verf; | ||
1276 | }; | 1279 | }; |
1277 | 1280 | ||
1278 | struct nfs_mds_commit_info { | 1281 | struct nfs_mds_commit_info { |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 04040476082e..21fde99e5c56 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -71,7 +71,9 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head, | |||
71 | msg->errno = err; | 71 | msg->errno = err; |
72 | destroy_msg(msg); | 72 | destroy_msg(msg); |
73 | } while (!list_empty(head)); | 73 | } while (!list_empty(head)); |
74 | wake_up(waitq); | 74 | |
75 | if (waitq) | ||
76 | wake_up(waitq); | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static void | 79 | static void |
@@ -91,11 +93,9 @@ rpc_timeout_upcall_queue(struct work_struct *work) | |||
91 | } | 93 | } |
92 | dentry = dget(pipe->dentry); | 94 | dentry = dget(pipe->dentry); |
93 | spin_unlock(&pipe->lock); | 95 | spin_unlock(&pipe->lock); |
94 | if (dentry) { | 96 | rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL, |
95 | rpc_purge_list(&RPC_I(dentry->d_inode)->waitq, | 97 | &free_list, destroy_msg, -ETIMEDOUT); |
96 | &free_list, destroy_msg, -ETIMEDOUT); | 98 | dput(dentry); |
97 | dput(dentry); | ||
98 | } | ||
99 | } | 99 | } |
100 | 100 | ||
101 | ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, | 101 | ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 7e9baaa1e543..3ee7461926d8 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -1374,7 +1374,8 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, | |||
1374 | sizeof(req->rq_snd_buf)); | 1374 | sizeof(req->rq_snd_buf)); |
1375 | return bc_send(req); | 1375 | return bc_send(req); |
1376 | } else { | 1376 | } else { |
1377 | /* Nothing to do to drop request */ | 1377 | /* drop request */ |
1378 | xprt_free_bc_request(req); | ||
1378 | return 0; | 1379 | return 0; |
1379 | } | 1380 | } |
1380 | } | 1381 | } |