diff options
| -rw-r--r-- | fs/nfs/file.c | 3 | ||||
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 5 | ||||
| -rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 5 | ||||
| -rw-r--r-- | net/sunrpc/bc_svc.c | 15 | ||||
| -rw-r--r-- | net/sunrpc/clnt.c | 1 | ||||
| -rw-r--r-- | net/sunrpc/rpc_pipe.c | 2 | ||||
| -rw-r--r-- | net/sunrpc/xprt.c | 22 | ||||
| -rw-r--r-- | net/sunrpc/xprtsock.c | 3 |
9 files changed, 22 insertions, 36 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index ae8d02294e46..ae0d92736531 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
| @@ -491,7 +491,8 @@ static int nfs_release_page(struct page *page, gfp_t gfp) | |||
| 491 | { | 491 | { |
| 492 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | 492 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); |
| 493 | 493 | ||
| 494 | if (gfp & __GFP_WAIT) | 494 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ |
| 495 | if ((gfp & GFP_KERNEL) == GFP_KERNEL) | ||
| 495 | nfs_wb_page(page->mapping->host, page); | 496 | nfs_wb_page(page->mapping->host, page); |
| 496 | /* If PagePrivate() is set, then the page is not freeable */ | 497 | /* If PagePrivate() is set, then the page is not freeable */ |
| 497 | if (PagePrivate(page)) | 498 | if (PagePrivate(page)) |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 4d338be492cb..dd17713413a5 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -5552,6 +5552,8 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nf | |||
| 5552 | if (status != 0) | 5552 | if (status != 0) |
| 5553 | goto out; | 5553 | goto out; |
| 5554 | status = decode_delegreturn(&xdr); | 5554 | status = decode_delegreturn(&xdr); |
| 5555 | if (status != 0) | ||
| 5556 | goto out; | ||
| 5555 | decode_getfattr(&xdr, res->fattr, res->server, | 5557 | decode_getfattr(&xdr, res->fattr, res->server, |
| 5556 | !RPC_IS_ASYNC(rqstp->rq_task)); | 5558 | !RPC_IS_ASYNC(rqstp->rq_task)); |
| 5557 | out: | 5559 | out: |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index d7152b451e21..7c91260c44a9 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -36,7 +36,6 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | |||
| 36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
| 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
| 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); |
| 39 | void bc_release_request(struct rpc_task *); | ||
| 40 | int bc_send(struct rpc_rqst *req); | 39 | int bc_send(struct rpc_rqst *req); |
| 41 | 40 | ||
| 42 | /* | 41 | /* |
| @@ -59,6 +58,10 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
| 59 | { | 58 | { |
| 60 | return 0; | 59 | return 0; |
| 61 | } | 60 | } |
| 61 | |||
| 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | ||
| 63 | { | ||
| 64 | } | ||
| 62 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_NFS_V4_1 */ |
| 63 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
| 64 | 67 | ||
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 0cfccc2a0297..c389ccf6437d 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
| @@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) | |||
| 1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; | 1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; |
| 1281 | return 0; | 1281 | return 0; |
| 1282 | out_free: | 1282 | out_free: |
| 1283 | for (i--; i >= 0; i--) { | 1283 | rqstp->rq_enc_pages_num = i; |
| 1284 | __free_page(rqstp->rq_enc_pages[i]); | 1284 | priv_release_snd_buf(rqstp); |
| 1285 | } | ||
| 1286 | out: | 1285 | out: |
| 1287 | return -EAGAIN; | 1286 | return -EAGAIN; |
| 1288 | } | 1287 | } |
diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c index 13f214f53120..f0c05d3311c1 100644 --- a/net/sunrpc/bc_svc.c +++ b/net/sunrpc/bc_svc.c | |||
| @@ -37,21 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| 37 | 37 | ||
| 38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
| 39 | 39 | ||
| 40 | void bc_release_request(struct rpc_task *task) | ||
| 41 | { | ||
| 42 | struct rpc_rqst *req = task->tk_rqstp; | ||
| 43 | |||
| 44 | dprintk("RPC: bc_release_request: task= %p\n", task); | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Release this request only if it's a backchannel | ||
| 48 | * preallocated request | ||
| 49 | */ | ||
| 50 | if (!bc_prealloc(req)) | ||
| 51 | return; | ||
| 52 | xprt_free_bc_request(req); | ||
| 53 | } | ||
| 54 | |||
| 55 | /* Empty callback ops */ | 40 | /* Empty callback ops */ |
| 56 | static const struct rpc_call_ops nfs41_callback_ops = { | 41 | static const struct rpc_call_ops nfs41_callback_ops = { |
| 57 | }; | 42 | }; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 154034b675bd..19c9983d5360 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
| @@ -659,6 +659,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
| 659 | task = rpc_new_task(&task_setup_data); | 659 | task = rpc_new_task(&task_setup_data); |
| 660 | if (!task) { | 660 | if (!task) { |
| 661 | xprt_free_bc_request(req); | 661 | xprt_free_bc_request(req); |
| 662 | task = ERR_PTR(-ENOMEM); | ||
| 662 | goto out; | 663 | goto out; |
| 663 | } | 664 | } |
| 664 | task->tk_rqstp = req; | 665 | task->tk_rqstp = req; |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 8d63f8fd29b7..20e30c6f8355 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
| @@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, | |||
| 587 | struct dentry *dentry; | 587 | struct dentry *dentry; |
| 588 | 588 | ||
| 589 | dentry = __rpc_lookup_create(parent, name); | 589 | dentry = __rpc_lookup_create(parent, name); |
| 590 | if (IS_ERR(dentry)) | ||
| 591 | return dentry; | ||
| 590 | if (dentry->d_inode == NULL) | 592 | if (dentry->d_inode == NULL) |
| 591 | return dentry; | 593 | return dentry; |
| 592 | dput(dentry); | 594 | dput(dentry); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 469de292c23c..42f09ade0044 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | #include <linux/sunrpc/clnt.h> | 47 | #include <linux/sunrpc/clnt.h> |
| 48 | #include <linux/sunrpc/metrics.h> | 48 | #include <linux/sunrpc/metrics.h> |
| 49 | #include <linux/sunrpc/bc_xprt.h> | ||
| 49 | 50 | ||
| 50 | #include "sunrpc.h" | 51 | #include "sunrpc.h" |
| 51 | 52 | ||
| @@ -1032,21 +1033,16 @@ void xprt_release(struct rpc_task *task) | |||
| 1032 | if (req->rq_release_snd_buf) | 1033 | if (req->rq_release_snd_buf) |
| 1033 | req->rq_release_snd_buf(req); | 1034 | req->rq_release_snd_buf(req); |
| 1034 | 1035 | ||
| 1035 | /* | ||
| 1036 | * Early exit if this is a backchannel preallocated request. | ||
| 1037 | * There is no need to have it added to the RPC slot list. | ||
| 1038 | */ | ||
| 1039 | if (is_bc_request) | ||
| 1040 | return; | ||
| 1041 | |||
| 1042 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
| 1043 | |||
| 1044 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); | 1036 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); |
| 1037 | if (likely(!is_bc_request)) { | ||
| 1038 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
| 1045 | 1039 | ||
| 1046 | spin_lock(&xprt->reserve_lock); | 1040 | spin_lock(&xprt->reserve_lock); |
| 1047 | list_add(&req->rq_list, &xprt->free); | 1041 | list_add(&req->rq_list, &xprt->free); |
| 1048 | rpc_wake_up_next(&xprt->backlog); | 1042 | rpc_wake_up_next(&xprt->backlog); |
| 1049 | spin_unlock(&xprt->reserve_lock); | 1043 | spin_unlock(&xprt->reserve_lock); |
| 1044 | } else | ||
| 1045 | xprt_free_bc_request(req); | ||
| 1050 | } | 1046 | } |
| 1051 | 1047 | ||
| 1052 | /** | 1048 | /** |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index e4839c07c913..9847c30b5001 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -2251,9 +2251,6 @@ static struct rpc_xprt_ops xs_tcp_ops = { | |||
| 2251 | .buf_free = rpc_free, | 2251 | .buf_free = rpc_free, |
| 2252 | .send_request = xs_tcp_send_request, | 2252 | .send_request = xs_tcp_send_request, |
| 2253 | .set_retrans_timeout = xprt_set_retrans_timeout_def, | 2253 | .set_retrans_timeout = xprt_set_retrans_timeout_def, |
| 2254 | #if defined(CONFIG_NFS_V4_1) | ||
| 2255 | .release_request = bc_release_request, | ||
| 2256 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 2257 | .close = xs_tcp_close, | 2254 | .close = xs_tcp_close, |
| 2258 | .destroy = xs_destroy, | 2255 | .destroy = xs_destroy, |
| 2259 | .print_stats = xs_tcp_print_stats, | 2256 | .print_stats = xs_tcp_print_stats, |
