Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
"Highlights include:

Bugfixes:
- Fix an Oops in SUNRPC back channel tracepoints
- Fix a SUNRPC client regression when handling oversized replies
- Fix the minimal size for SUNRPC reply buffer allocation
- rpc_decode_header() must always return a non-zero value on error
- Fix a typo in pnfs_update_layout()

Cleanup:
- Remove redundant check for the reply length in call_decode()"

* tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
SUNRPC: Remove redundant check for the reply length in call_decode()
SUNRPC: Handle the SYSTEM_ERR rpc error
SUNRPC: rpc_decode_header() must always return a non-zero value on error
SUNRPC: Use the ENOTCONN error on socket disconnect
SUNRPC: Fix the minimal size for reply buffer allocation
SUNRPC: Fix a client regression when handling oversized replies
pNFS: Fix a typo in pnfs_update_layout
fix null pointer deref in tracepoints in back channel

+21 -23
+1 -1
fs/nfs/pnfs.c
··· 1889 1889 atomic_read(&lo->plh_outstanding) != 0) { 1890 1890 spin_unlock(&ino->i_lock); 1891 1891 lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding, 1892 - atomic_read(&lo->plh_outstanding))); 1892 + !atomic_read(&lo->plh_outstanding))); 1893 1893 if (IS_ERR(lseg) || !list_empty(&lo->plh_segs)) 1894 1894 goto out_put_layout_hdr; 1895 1895 pnfs_put_layout_hdr(lo);
+4 -2
include/trace/events/sunrpc.h
··· 712 712 713 713 TP_fast_assign( 714 714 __entry->task_id = rqst->rq_task->tk_pid; 715 - __entry->client_id = rqst->rq_task->tk_client->cl_clid; 715 + __entry->client_id = rqst->rq_task->tk_client ? 716 + rqst->rq_task->tk_client->cl_clid : -1; 716 717 __entry->xid = be32_to_cpu(rqst->rq_xid); 717 718 __entry->seqno = rqst->rq_seqno; 718 719 __entry->status = status; ··· 743 742 744 743 TP_fast_assign( 745 744 __entry->task_id = task->tk_pid; 746 - __entry->client_id = task->tk_client->cl_clid; 745 + __entry->client_id = task->tk_client ? 746 + task->tk_client->cl_clid : -1; 747 747 __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); 748 748 __entry->seqno = task->tk_rqstp->rq_seqno; 749 749 __entry->stage = stage;
+14 -18
net/sunrpc/clnt.c
··· 1730 1730 req->rq_callsize = RPC_CALLHDRSIZE + (auth->au_cslack << 1) + 1731 1731 proc->p_arglen; 1732 1732 req->rq_callsize <<= 2; 1733 - req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + proc->p_replen; 1733 + /* 1734 + * Note: the reply buffer must at minimum allocate enough space 1735 + * for the 'struct accepted_reply' from RFC5531. 1736 + */ 1737 + req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + \ 1738 + max_t(size_t, proc->p_replen, 2); 1734 1739 req->rq_rcvsize <<= 2; 1735 1740 1736 1741 status = xprt->ops->buf_alloc(task); ··· 2392 2387 WARN_ON(memcmp(&req->rq_rcv_buf, &req->rq_private_buf, 2393 2388 sizeof(req->rq_rcv_buf)) != 0); 2394 2389 2395 - if (req->rq_rcv_buf.len < 12) 2396 - goto out_retry; 2397 - 2398 2390 xdr_init_decode(&xdr, &req->rq_rcv_buf, 2399 2391 req->rq_rcv_buf.head[0].iov_base, req); 2400 2392 switch (rpc_decode_header(task, &xdr)) { ··· 2402 2400 task->tk_pid, __func__, task->tk_status); 2403 2401 return; 2404 2402 case -EAGAIN: 2405 - out_retry: 2406 2403 task->tk_status = 0; 2407 2404 /* Note: rpc_decode_header() may have freed the RPC slot */ 2408 2405 if (task->tk_rqstp == req) { ··· 2450 2449 rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) 2451 2450 { 2452 2451 struct rpc_clnt *clnt = task->tk_client; 2453 - int error = -EACCES; 2452 + int error; 2454 2453 __be32 *p; 2455 2454 2456 2455 /* RFC-1014 says that the representation of XDR data must be a ··· 2459 2458 * undefined results 2460 2459 */ 2461 2460 if (task->tk_rqstp->rq_rcv_buf.len & 3) 2462 - goto out_badlen; 2461 + goto out_unparsable; 2463 2462 2464 2463 p = xdr_inline_decode(xdr, 3 * sizeof(*p)); 2465 2464 if (!p) ··· 2493 2492 error = -EOPNOTSUPP; 2494 2493 goto out_err; 2495 2494 case rpc_garbage_args: 2495 + case rpc_system_err: 2496 2496 trace_rpc__garbage_args(task); 2497 + error = -EIO; 2497 2498 break; 2498 2499 default: 2499 - trace_rpc__unparsable(task); 2500 + goto out_unparsable; 2500 2501 } 2501 2502 2502 2503 out_garbage: ··· 2512 2509 rpc_exit(task, error); 2513 2510 return error; 2514 2511 2515 - out_badlen: 2516 - trace_rpc__unparsable(task); 2517 - error = -EIO; 2518 - goto out_err; 2519 - 2520 2512 out_unparsable: 2521 2513 trace_rpc__unparsable(task); 2522 2514 error = -EIO; ··· 2522 2524 goto out_garbage; 2523 2525 2524 2526 out_msg_denied: 2527 + error = -EACCES; 2525 2528 p = xdr_inline_decode(xdr, sizeof(*p)); 2526 2529 if (!p) 2527 2530 goto out_unparsable; ··· 2534 2535 error = -EPROTONOSUPPORT; 2535 2536 goto out_err; 2536 2537 default: 2537 - trace_rpc__unparsable(task); 2538 - error = -EIO; 2539 - goto out_err; 2538 + goto out_unparsable; 2540 2539 } 2541 2540 2542 2541 p = xdr_inline_decode(xdr, sizeof(*p)); ··· 2569 2572 task->tk_xprt->servername); 2570 2573 break; 2571 2574 default: 2572 - trace_rpc__unparsable(task); 2573 - error = -EIO; 2575 + goto out_unparsable; 2574 2576 } 2575 2577 goto out_err; 2576 2578 }
+1 -1
net/sunrpc/xprt.c
··· 664 664 spin_lock_bh(&xprt->transport_lock); 665 665 xprt_clear_connected(xprt); 666 666 xprt_clear_write_space_locked(xprt); 667 - xprt_wake_pending_tasks(xprt, -EAGAIN); 667 + xprt_wake_pending_tasks(xprt, -ENOTCONN); 668 668 spin_unlock_bh(&xprt->transport_lock); 669 669 } 670 670 EXPORT_SYMBOL_GPL(xprt_disconnect_done);
+1 -1
net/sunrpc/xprtsock.c
··· 453 453 goto out; 454 454 if (ret != want) 455 455 goto out; 456 - } else 456 + } else if (offset < seek_init) 457 457 offset = seek_init; 458 458 ret = -EMSGSIZE; 459 459 out: