Do not cast the struct xprt to a sock_xprt unless we know it is a UDP or TCP transport. Otherwise the call to lock the mutex will scribble over whatever structure is actually there. This has been seen to cause hard system lockups when the underlying transport was RDMA.
Showing the changes to include (2 of 4 files). Show all
Unified · Split
| @@ -139,6 +139,9 @@ struct rpc_xprt_ops { · 138 unmodified lines | |||
| 139 | void (*rpcbind)(struct rpc_task *task); | 139 | void (*rpcbind)(struct rpc_task *task); |
| 140 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 140 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
| 141 | void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task); | 141 | void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 142 | int (*get_srcaddr)(struct rpc_xprt *xprt, char *buf, | ||
| 143 | size_t buflen); | ||
| 144 | unsigned short (*get_srcport)(struct rpc_xprt *xprt); | ||
| 142 | int (*buf_alloc)(struct rpc_task *task); | 145 | int (*buf_alloc)(struct rpc_task *task); |
| 143 | void (*buf_free)(struct rpc_task *task); | 146 | void (*buf_free)(struct rpc_task *task); |
| 144 | void (*prepare_request)(struct rpc_rqst *req); | 147 | void (*prepare_request)(struct rpc_rqst *req); |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | int init_socket_xprt(void); | 11 | int init_socket_xprt(void); |
| 12 | void cleanup_socket_xprt(void); | 12 | void cleanup_socket_xprt(void); |
| 13 | unsigned short get_srcport(struct rpc_xprt *); | ||
| 14 | 13 | ||
| 15 | #define RPC_MIN_RESVPORT (1U) | 14 | #define RPC_MIN_RESVPORT (1U) |
| 16 | #define RPC_MAX_RESVPORT (65535U) | 15 | #define RPC_MAX_RESVPORT (65535U) |