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

Merge tag 'nfsd-4.21' of git://linux-nfs.org/~bfields/linux

Pull nfsd updates from Bruce Fields:
"Thanks to Vasily Averin for fixing a use-after-free in the
containerized NFSv4.2 client, and cleaning up some convoluted
backchannel server code in the process.

Otherwise, miscellaneous smaller bugfixes and cleanup"

* tag 'nfsd-4.21' of git://linux-nfs.org/~bfields/linux: (25 commits)
nfs: fixed broken compilation in nfs_callback_up_net()
nfs: minor typo in nfs4_callback_up_net()
sunrpc: fix debug message in svc_create_xprt()
sunrpc: make visible processing error in bc_svc_process()
sunrpc: remove unused xpo_prep_reply_hdr callback
sunrpc: remove svc_rdma_bc_class
sunrpc: remove svc_tcp_bc_class
sunrpc: remove unused bc_up operation from rpc_xprt_ops
sunrpc: replace svc_serv->sv_bc_xprt by boolean flag
sunrpc: use-after-free in svc_process_common()
sunrpc: use SVC_NET() in svcauth_gss_* functions
nfsd: drop useless LIST_HEAD
lockd: Show pid of lockd for remote locks
NFSD remove OP_CACHEME from 4.2 op_flags
nfsd: Return EPERM, not EACCES, in some SETATTR cases
sunrpc: fix cache_head leak due to queued request
nfsd: clean up indentation, increase indentation in switch statement
svcrdma: Optimize the logic that selects the R_key to invalidate
nfsd: fix a warning in __cld_pipe_upcall()
nfsd4: fix crash on writing v4_end_grace before nfsd startup
...

+192 -360
+6 -16
fs/lockd/clnt4xdr.c
··· 128 128 static int decode_netobj(struct xdr_stream *xdr, 129 129 struct xdr_netobj *obj) 130 130 { 131 - u32 length; 132 - __be32 *p; 131 + ssize_t ret; 133 132 134 - p = xdr_inline_decode(xdr, 4); 135 - if (unlikely(p == NULL)) 136 - goto out_overflow; 137 - length = be32_to_cpup(p++); 138 - if (unlikely(length > XDR_MAX_NETOBJ)) 139 - goto out_size; 140 - obj->len = length; 141 - obj->data = (u8 *)p; 133 + ret = xdr_stream_decode_opaque_inline(xdr, (void *)&obj->data, 134 + XDR_MAX_NETOBJ); 135 + if (unlikely(ret < 0)) 136 + return -EIO; 137 + obj->len = ret; 142 138 return 0; 143 - out_size: 144 - dprintk("NFS: returned netobj was too long: %u\n", length); 145 - return -EIO; 146 - out_overflow: 147 - print_overflow_msg(__func__, xdr); 148 - return -EIO; 149 139 } 150 140 151 141 /*
+1 -1
fs/lockd/clntproc.c
··· 442 442 fl->fl_start = req->a_res.lock.fl.fl_start; 443 443 fl->fl_end = req->a_res.lock.fl.fl_end; 444 444 fl->fl_type = req->a_res.lock.fl.fl_type; 445 - fl->fl_pid = 0; 445 + fl->fl_pid = -req->a_res.lock.fl.fl_pid; 446 446 break; 447 447 default: 448 448 status = nlm_stat_to_errno(req->a_res.status);
+6 -16
fs/lockd/clntxdr.c
··· 125 125 static int decode_netobj(struct xdr_stream *xdr, 126 126 struct xdr_netobj *obj) 127 127 { 128 - u32 length; 129 - __be32 *p; 128 + ssize_t ret; 130 129 131 - p = xdr_inline_decode(xdr, 4); 132 - if (unlikely(p == NULL)) 133 - goto out_overflow; 134 - length = be32_to_cpup(p++); 135 - if (unlikely(length > XDR_MAX_NETOBJ)) 136 - goto out_size; 137 - obj->len = length; 138 - obj->data = (u8 *)p; 130 + ret = xdr_stream_decode_opaque_inline(xdr, (void *)&obj->data, 131 + XDR_MAX_NETOBJ); 132 + if (unlikely(ret < 0)) 133 + return -EIO; 134 + obj->len = ret; 139 135 return 0; 140 - out_size: 141 - dprintk("NFS: returned netobj was too long: %u\n", length); 142 - return -EIO; 143 - out_overflow: 144 - print_overflow_msg(__func__, xdr); 145 - return -EIO; 146 136 } 147 137 148 138 /*
+2 -2
fs/lockd/xdr.c
··· 127 127 128 128 locks_init_lock(fl); 129 129 fl->fl_owner = current->files; 130 - fl->fl_pid = (pid_t)lock->svid; 130 + fl->fl_pid = current->tgid; 131 131 fl->fl_flags = FL_POSIX; 132 132 fl->fl_type = F_RDLCK; /* as good as anything else */ 133 133 start = ntohl(*p++); ··· 269 269 memset(lock, 0, sizeof(*lock)); 270 270 locks_init_lock(&lock->fl); 271 271 lock->svid = ~(u32) 0; 272 - lock->fl.fl_pid = (pid_t)lock->svid; 272 + lock->fl.fl_pid = current->tgid; 273 273 274 274 if (!(p = nlm_decode_cookie(p, &argp->cookie)) 275 275 || !(p = xdr_decode_string_inplace(p, &lock->caller,
+2 -2
fs/lockd/xdr4.c
··· 119 119 120 120 locks_init_lock(fl); 121 121 fl->fl_owner = current->files; 122 - fl->fl_pid = (pid_t)lock->svid; 122 + fl->fl_pid = current->tgid; 123 123 fl->fl_flags = FL_POSIX; 124 124 fl->fl_type = F_RDLCK; /* as good as anything else */ 125 125 p = xdr_decode_hyper(p, &start); ··· 266 266 memset(lock, 0, sizeof(*lock)); 267 267 locks_init_lock(&lock->fl); 268 268 lock->svid = ~(u32) 0; 269 - lock->fl.fl_pid = (pid_t)lock->svid; 269 + lock->fl.fl_pid = current->tgid; 270 270 271 271 if (!(p = nlm4_decode_cookie(p, &argp->cookie)) 272 272 || !(p = xdr_decode_string_inplace(p, &lock->caller,
+6 -4
fs/nfs/callback.c
··· 56 56 nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); 57 57 if (ret > 0) { 58 58 nn->nfs_callback_tcpport6 = ret; 59 - dprintk("NFS: Callback listener port = %u (af %u, net %x\n", 59 + dprintk("NFS: Callback listener port = %u (af %u, net %x)\n", 60 60 nn->nfs_callback_tcpport6, PF_INET6, net->ns.inum); 61 61 } else if (ret != -EAFNOSUPPORT) 62 62 goto out_err; ··· 206 206 goto err_bind; 207 207 } 208 208 209 - ret = -EPROTONOSUPPORT; 209 + ret = 0; 210 210 if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0) 211 211 ret = nfs4_callback_up_net(serv, net); 212 - else if (xprt->ops->bc_up) 213 - ret = xprt->ops->bc_up(serv, net); 212 + else if (xprt->ops->bc_setup) 213 + set_bc_enabled(serv); 214 + else 215 + ret = -EPROTONOSUPPORT; 214 216 215 217 if (ret < 0) { 216 218 printk(KERN_ERR "NFS: callback service start failed\n");
-1
fs/nfsd/nfs4layouts.c
··· 656 656 struct nfsd_net *nn; 657 657 ktime_t now, cutoff; 658 658 const struct nfsd4_layout_ops *ops; 659 - LIST_HEAD(reaplist); 660 659 661 660 662 661 switch (task->tk_status) {
+6 -9
fs/nfsd/nfs4proc.c
··· 863 863 struct nfsd4_rename *rename = &u->rename; 864 864 __be32 status; 865 865 866 - if (opens_in_grace(SVC_NET(rqstp)) && 867 - !(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK)) 866 + if (opens_in_grace(SVC_NET(rqstp))) 868 867 return nfserr_grace; 869 868 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, 870 869 rename->rn_snamelen, &cstate->current_fh, ··· 1015 1016 1016 1017 nvecs = svc_fill_write_vector(rqstp, write->wr_pagelist, 1017 1018 &write->wr_head, write->wr_buflen); 1018 - if (!nvecs) 1019 - return nfserr_io; 1020 1019 WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec)); 1021 1020 1022 1021 status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp, ··· 1345 1348 nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1346 1349 struct nfsd4_fallocate *fallocate, int flags) 1347 1350 { 1348 - __be32 status = nfserr_notsupp; 1351 + __be32 status; 1349 1352 struct file *file; 1350 1353 1351 1354 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, ··· 2679 2682 /* NFSv4.2 operations */ 2680 2683 [OP_ALLOCATE] = { 2681 2684 .op_func = nfsd4_allocate, 2682 - .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2685 + .op_flags = OP_MODIFIES_SOMETHING, 2683 2686 .op_name = "OP_ALLOCATE", 2684 2687 .op_rsize_bop = nfsd4_only_status_rsize, 2685 2688 }, 2686 2689 [OP_DEALLOCATE] = { 2687 2690 .op_func = nfsd4_deallocate, 2688 - .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2691 + .op_flags = OP_MODIFIES_SOMETHING, 2689 2692 .op_name = "OP_DEALLOCATE", 2690 2693 .op_rsize_bop = nfsd4_only_status_rsize, 2691 2694 }, 2692 2695 [OP_CLONE] = { 2693 2696 .op_func = nfsd4_clone, 2694 - .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2697 + .op_flags = OP_MODIFIES_SOMETHING, 2695 2698 .op_name = "OP_CLONE", 2696 2699 .op_rsize_bop = nfsd4_only_status_rsize, 2697 2700 }, 2698 2701 [OP_COPY] = { 2699 2702 .op_func = nfsd4_copy, 2700 - .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2703 + .op_flags = OP_MODIFIES_SOMETHING, 2701 2704 .op_name = "OP_COPY", 2702 2705 .op_rsize_bop = nfsd4_copy_rsize, 2703 2706 },
+6 -11
fs/nfsd/nfs4recover.c
··· 662 662 struct cld_upcall { 663 663 struct list_head cu_list; 664 664 struct cld_net *cu_net; 665 - struct task_struct *cu_task; 665 + struct completion cu_done; 666 666 struct cld_msg cu_msg; 667 667 }; 668 668 ··· 671 671 { 672 672 int ret; 673 673 struct rpc_pipe_msg msg; 674 + struct cld_upcall *cup = container_of(cmsg, struct cld_upcall, cu_msg); 674 675 675 676 memset(&msg, 0, sizeof(msg)); 676 677 msg.data = cmsg; 677 678 msg.len = sizeof(*cmsg); 678 679 679 - /* 680 - * Set task state before we queue the upcall. That prevents 681 - * wake_up_process in the downcall from racing with schedule. 682 - */ 683 - set_current_state(TASK_UNINTERRUPTIBLE); 684 680 ret = rpc_queue_upcall(pipe, &msg); 685 681 if (ret < 0) { 686 - set_current_state(TASK_RUNNING); 687 682 goto out; 688 683 } 689 684 690 - schedule(); 685 + wait_for_completion(&cup->cu_done); 691 686 692 687 if (msg.errno < 0) 693 688 ret = msg.errno; ··· 749 754 if (copy_from_user(&cup->cu_msg, src, mlen) != 0) 750 755 return -EFAULT; 751 756 752 - wake_up_process(cup->cu_task); 757 + complete(&cup->cu_done); 753 758 return mlen; 754 759 } 755 760 ··· 764 769 if (msg->errno >= 0) 765 770 return; 766 771 767 - wake_up_process(cup->cu_task); 772 + complete(&cup->cu_done); 768 773 } 769 774 770 775 static const struct rpc_pipe_ops cld_upcall_ops = { ··· 895 900 goto restart_search; 896 901 } 897 902 } 898 - new->cu_task = current; 903 + init_completion(&new->cu_done); 899 904 new->cu_msg.cm_vers = CLD_UPCALL_VERSION; 900 905 put_unaligned(cn->cn_xid++, &new->cu_msg.cm_xid); 901 906 new->cu_net = cn;
+5 -5
fs/nfsd/nfs4state.c
··· 5112 5112 } 5113 5113 5114 5114 static __be32 5115 - nfs4_check_olstateid(struct svc_fh *fhp, struct nfs4_ol_stateid *ols, int flags) 5115 + nfs4_check_olstateid(struct nfs4_ol_stateid *ols, int flags) 5116 5116 { 5117 5117 __be32 status; 5118 5118 ··· 5195 5195 break; 5196 5196 case NFS4_OPEN_STID: 5197 5197 case NFS4_LOCK_STID: 5198 - status = nfs4_check_olstateid(fhp, openlockstateid(s), flags); 5198 + status = nfs4_check_olstateid(openlockstateid(s), flags); 5199 5199 break; 5200 5200 default: 5201 5201 status = nfserr_bad_stateid; ··· 6230 6230 case NFS4_READ_LT: 6231 6231 case NFS4_READW_LT: 6232 6232 file_lock->fl_type = F_RDLCK; 6233 - break; 6233 + break; 6234 6234 case NFS4_WRITE_LT: 6235 6235 case NFS4_WRITEW_LT: 6236 6236 file_lock->fl_type = F_WRLCK; 6237 - break; 6237 + break; 6238 6238 default: 6239 6239 dprintk("NFSD: nfs4_lockt: bad lock type!\n"); 6240 6240 status = nfserr_inval; 6241 - goto out; 6241 + goto out; 6242 6242 } 6243 6243 6244 6244 lo = find_lockowner_str(cstate->clp, &lockt->lt_owner);
+2
fs/nfsd/nfsctl.c
··· 1126 1126 case 'Y': 1127 1127 case 'y': 1128 1128 case '1': 1129 + if (nn->nfsd_serv) 1130 + return -EBUSY; 1129 1131 nfsd4_end_grace(nn); 1130 1132 break; 1131 1133 default:
+15 -2
fs/nfsd/vfs.c
··· 396 396 bool get_write_count; 397 397 bool size_change = (iap->ia_valid & ATTR_SIZE); 398 398 399 - if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE)) 399 + if (iap->ia_valid & ATTR_SIZE) { 400 400 accmode |= NFSD_MAY_WRITE|NFSD_MAY_OWNER_OVERRIDE; 401 - if (iap->ia_valid & ATTR_SIZE) 402 401 ftype = S_IFREG; 402 + } 403 + 404 + /* 405 + * If utimes(2) and friends are called with times not NULL, we should 406 + * not set NFSD_MAY_WRITE bit. Otherwise fh_verify->nfsd_permission 407 + * will return EACCESS, when the caller's effective UID does not match 408 + * the owner of the file, and the caller is not privileged. In this 409 + * situation, we should return EPERM(notify_change will return this). 410 + */ 411 + if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME)) { 412 + accmode |= NFSD_MAY_OWNER_OVERRIDE; 413 + if (!(iap->ia_valid & (ATTR_ATIME_SET | ATTR_MTIME_SET))) 414 + accmode |= NFSD_MAY_WRITE; 415 + } 403 416 404 417 /* Callers that do fh_verify should do the fh_want_write: */ 405 418 get_write_count = !fhp->fh_dentry;
+13 -6
include/linux/sunrpc/bc_xprt.h
··· 47 47 /* 48 48 * Determine if a shared backchannel is in use 49 49 */ 50 - static inline int svc_is_backchannel(const struct svc_rqst *rqstp) 50 + static inline bool svc_is_backchannel(const struct svc_rqst *rqstp) 51 51 { 52 - if (rqstp->rq_server->sv_bc_xprt) 53 - return 1; 54 - return 0; 52 + return rqstp->rq_server->sv_bc_enabled; 53 + } 54 + 55 + static inline void set_bc_enabled(struct svc_serv *serv) 56 + { 57 + serv->sv_bc_enabled = true; 55 58 } 56 59 #else /* CONFIG_SUNRPC_BACKCHANNEL */ 57 60 static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, ··· 63 60 return 0; 64 61 } 65 62 66 - static inline int svc_is_backchannel(const struct svc_rqst *rqstp) 63 + static inline bool svc_is_backchannel(const struct svc_rqst *rqstp) 67 64 { 68 - return 0; 65 + return false; 66 + } 67 + 68 + static inline void set_bc_enabled(struct svc_serv *serv) 69 + { 69 70 } 70 71 71 72 static inline void xprt_free_bc_request(struct rpc_rqst *req)
+5 -2
include/linux/sunrpc/svc.h
··· 109 109 spinlock_t sv_cb_lock; /* protects the svc_cb_list */ 110 110 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no 111 111 * entries in the svc_cb_list */ 112 - struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ 112 + bool sv_bc_enabled; /* service uses backchannel */ 113 113 #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 114 114 }; 115 115 ··· 295 295 struct svc_cacherep * rq_cacherep; /* cache info */ 296 296 struct task_struct *rq_task; /* service thread */ 297 297 spinlock_t rq_lock; /* per-request lock */ 298 + struct net *rq_bc_net; /* pointer to backchannel's 299 + * net namespace 300 + */ 298 301 }; 299 302 300 - #define SVC_NET(svc_rqst) (svc_rqst->rq_xprt->xpt_net) 303 + #define SVC_NET(rqst) (rqst->rq_xprt ? rqst->rq_xprt->xpt_net : rqst->rq_bc_net) 301 304 302 305 /* 303 306 * Rigorous type checking on sockaddr type conversions
+1 -1
include/linux/sunrpc/svc_rdma.h
··· 135 135 u32 rc_byte_len; 136 136 unsigned int rc_page_count; 137 137 unsigned int rc_hdr_count; 138 + u32 rc_inv_rkey; 138 139 struct page *rc_pages[RPCSVC_MAXPAGES]; 139 140 }; 140 141 ··· 193 192 extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); 194 193 extern void svc_sq_reap(struct svcxprt_rdma *); 195 194 extern void svc_rq_reap(struct svcxprt_rdma *); 196 - extern void svc_rdma_prep_reply_hdr(struct svc_rqst *); 197 195 198 196 extern struct svc_xprt_class svc_rdma_class; 199 197 #ifdef CONFIG_SUNRPC_BACKCHANNEL
-1
include/linux/sunrpc/svc_xprt.h
··· 20 20 struct svc_xprt *(*xpo_accept)(struct svc_xprt *); 21 21 int (*xpo_has_wspace)(struct svc_xprt *); 22 22 int (*xpo_recvfrom)(struct svc_rqst *); 23 - void (*xpo_prep_reply_hdr)(struct svc_rqst *); 24 23 int (*xpo_sendto)(struct svc_rqst *); 25 24 void (*xpo_release_rqst)(struct svc_rqst *); 26 25 void (*xpo_detach)(struct svc_xprt *);
-1
include/linux/sunrpc/xprt.h
··· 157 157 void (*inject_disconnect)(struct rpc_xprt *xprt); 158 158 int (*bc_setup)(struct rpc_xprt *xprt, 159 159 unsigned int min_reqs); 160 - int (*bc_up)(struct svc_serv *serv, struct net *net); 161 160 size_t (*bc_maxpayload)(struct rpc_xprt *xprt); 162 161 void (*bc_free_rqst)(struct rpc_rqst *rqst); 163 162 void (*bc_destroy)(struct rpc_xprt *xprt,
+4 -2
include/trace/events/sunrpc.h
··· 569 569 __field(u32, vers) 570 570 __field(u32, proc) 571 571 __string(service, name) 572 - __string(addr, rqst->rq_xprt->xpt_remotebuf) 572 + __string(addr, rqst->rq_xprt ? 573 + rqst->rq_xprt->xpt_remotebuf : "(null)") 573 574 ), 574 575 575 576 TP_fast_assign( ··· 578 577 __entry->vers = rqst->rq_vers; 579 578 __entry->proc = rqst->rq_proc; 580 579 __assign_str(service, name); 581 - __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); 580 + __assign_str(addr, rqst->rq_xprt ? 581 + rqst->rq_xprt->xpt_remotebuf : "(null)"); 582 582 ), 583 583 584 584 TP_printk("addr=%s xid=0x%08x service=%s vers=%u proc=%u",
+4 -4
net/sunrpc/auth_gss/svcauth_gss.c
··· 1142 1142 struct kvec *resv = &rqstp->rq_res.head[0]; 1143 1143 struct rsi *rsip, rsikey; 1144 1144 int ret; 1145 - struct sunrpc_net *sn = net_generic(rqstp->rq_xprt->xpt_net, sunrpc_net_id); 1145 + struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); 1146 1146 1147 1147 memset(&rsikey, 0, sizeof(rsikey)); 1148 1148 ret = gss_read_verf(gc, argv, authp, ··· 1253 1253 uint64_t handle; 1254 1254 int status; 1255 1255 int ret; 1256 - struct net *net = rqstp->rq_xprt->xpt_net; 1256 + struct net *net = SVC_NET(rqstp); 1257 1257 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); 1258 1258 1259 1259 memset(&ud, 0, sizeof(ud)); ··· 1444 1444 __be32 *rpcstart; 1445 1445 __be32 *reject_stat = resv->iov_base + resv->iov_len; 1446 1446 int ret; 1447 - struct sunrpc_net *sn = net_generic(rqstp->rq_xprt->xpt_net, sunrpc_net_id); 1447 + struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); 1448 1448 1449 1449 dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n", 1450 1450 argv->iov_len); ··· 1734 1734 struct rpc_gss_wire_cred *gc = &gsd->clcred; 1735 1735 struct xdr_buf *resbuf = &rqstp->rq_res; 1736 1736 int stat = -EINVAL; 1737 - struct sunrpc_net *sn = net_generic(rqstp->rq_xprt->xpt_net, sunrpc_net_id); 1737 + struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); 1738 1738 1739 1739 if (gc->gc_proc != RPC_GSS_PROC_DATA) 1740 1740 goto out;
+9 -1
net/sunrpc/cache.c
··· 54 54 h->last_refresh = now; 55 55 } 56 56 57 + static void cache_fresh_locked(struct cache_head *head, time_t expiry, 58 + struct cache_detail *detail); 59 + static void cache_fresh_unlocked(struct cache_head *head, 60 + struct cache_detail *detail); 61 + 57 62 static struct cache_head *sunrpc_cache_find_rcu(struct cache_detail *detail, 58 63 struct cache_head *key, 59 64 int hash) ··· 105 100 if (cache_is_expired(detail, tmp)) { 106 101 hlist_del_init_rcu(&tmp->cache_list); 107 102 detail->entries --; 103 + cache_fresh_locked(tmp, 0, detail); 108 104 freeme = tmp; 109 105 break; 110 106 } ··· 121 115 cache_get(new); 122 116 spin_unlock(&detail->hash_lock); 123 117 124 - if (freeme) 118 + if (freeme) { 119 + cache_fresh_unlocked(freeme, detail); 125 120 cache_put(freeme, detail); 121 + } 126 122 return new; 127 123 } 128 124
+18 -6
net/sunrpc/svc.c
··· 1145 1145 #endif 1146 1146 1147 1147 /* 1148 + * Setup response header for TCP, it has a 4B record length field. 1149 + */ 1150 + static void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp) 1151 + { 1152 + struct kvec *resv = &rqstp->rq_res.head[0]; 1153 + 1154 + /* tcp needs a space for the record length... */ 1155 + svc_putnl(resv, 0); 1156 + } 1157 + 1158 + /* 1148 1159 * Common routine for processing the RPC request. 1149 1160 */ 1150 1161 static int ··· 1183 1172 clear_bit(RQ_DROPME, &rqstp->rq_flags); 1184 1173 1185 1174 /* Setup reply header */ 1186 - rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp); 1175 + if (rqstp->rq_prot == IPPROTO_TCP) 1176 + svc_tcp_prep_reply_hdr(rqstp); 1187 1177 1188 1178 svc_putu32(resv, rqstp->rq_xid); 1189 1179 ··· 1256 1244 * for lower versions. RPC_PROG_MISMATCH seems to be the closest 1257 1245 * fit. 1258 1246 */ 1259 - if (versp->vs_need_cong_ctrl && 1247 + if (versp->vs_need_cong_ctrl && rqstp->rq_xprt && 1260 1248 !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags)) 1261 1249 goto err_bad_vers; 1262 1250 ··· 1348 1336 return 0; 1349 1337 1350 1338 close: 1351 - if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) 1339 + if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) 1352 1340 svc_close_xprt(rqstp->rq_xprt); 1353 1341 dprintk("svc: svc_process close\n"); 1354 1342 return 0; ··· 1471 1459 dprintk("svc: %s(%p)\n", __func__, req); 1472 1460 1473 1461 /* Build the svc_rqst used by the common processing routine */ 1474 - rqstp->rq_xprt = serv->sv_bc_xprt; 1475 1462 rqstp->rq_xid = req->rq_xid; 1476 1463 rqstp->rq_prot = req->rq_xprt->prot; 1477 1464 rqstp->rq_server = serv; 1465 + rqstp->rq_bc_net = req->rq_xprt->xprt_net; 1478 1466 1479 1467 rqstp->rq_addrlen = sizeof(req->rq_xprt->addr); 1480 1468 memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen); ··· 1511 1499 if (!proc_error) { 1512 1500 /* Processing error: drop the request */ 1513 1501 xprt_free_bc_request(req); 1514 - return 0; 1502 + error = -EINVAL; 1503 + goto out; 1515 1504 } 1516 - 1517 1505 /* Finally, send the reply synchronously */ 1518 1506 memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf)); 1519 1507 task = rpc_run_bc_task(req);
+5 -4
net/sunrpc/svc_xprt.c
··· 296 296 request_module("svc%s", xprt_name); 297 297 err = _svc_create_xprt(serv, xprt_name, net, family, port, flags); 298 298 } 299 - if (err) 299 + if (err < 0) 300 300 dprintk("svc: transport %s not found, err %d\n", 301 - xprt_name, err); 301 + xprt_name, -err); 302 302 return err; 303 303 } 304 304 EXPORT_SYMBOL_GPL(svc_create_xprt); ··· 468 468 */ 469 469 void svc_reserve(struct svc_rqst *rqstp, int space) 470 470 { 471 + struct svc_xprt *xprt = rqstp->rq_xprt; 472 + 471 473 space += rqstp->rq_res.head[0].iov_len; 472 474 473 - if (space < rqstp->rq_reserved) { 474 - struct svc_xprt *xprt = rqstp->rq_xprt; 475 + if (xprt && space < rqstp->rq_reserved) { 475 476 atomic_sub((rqstp->rq_reserved - space), &xprt->xpt_reserved); 476 477 rqstp->rq_reserved = space; 477 478
-120
net/sunrpc/svcsock.c
··· 70 70 static struct svc_xprt *svc_create_socket(struct svc_serv *, int, 71 71 struct net *, struct sockaddr *, 72 72 int, int); 73 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 74 - static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, 75 - struct net *, struct sockaddr *, 76 - int, int); 77 - static void svc_bc_sock_free(struct svc_xprt *xprt); 78 - #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 79 - 80 73 #ifdef CONFIG_DEBUG_LOCK_ALLOC 81 74 static struct lock_class_key svc_key[2]; 82 75 static struct lock_class_key svc_slock_key[2]; ··· 610 617 return error; 611 618 } 612 619 613 - static void svc_udp_prep_reply_hdr(struct svc_rqst *rqstp) 614 - { 615 - } 616 - 617 620 static int svc_udp_has_wspace(struct svc_xprt *xprt) 618 621 { 619 622 struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); ··· 653 664 .xpo_release_rqst = svc_release_udp_skb, 654 665 .xpo_detach = svc_sock_detach, 655 666 .xpo_free = svc_sock_free, 656 - .xpo_prep_reply_hdr = svc_udp_prep_reply_hdr, 657 667 .xpo_has_wspace = svc_udp_has_wspace, 658 668 .xpo_accept = svc_udp_accept, 659 669 .xpo_secure_port = svc_sock_secure_port, ··· 1158 1170 return sent; 1159 1171 } 1160 1172 1161 - /* 1162 - * Setup response header. TCP has a 4B record length field. 1163 - */ 1164 - static void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp) 1165 - { 1166 - struct kvec *resv = &rqstp->rq_res.head[0]; 1167 - 1168 - /* tcp needs a space for the record length... */ 1169 - svc_putnl(resv, 0); 1170 - } 1171 - 1172 1173 static struct svc_xprt *svc_tcp_create(struct svc_serv *serv, 1173 1174 struct net *net, 1174 1175 struct sockaddr *sa, int salen, ··· 1166 1189 return svc_create_socket(serv, IPPROTO_TCP, net, sa, salen, flags); 1167 1190 } 1168 1191 1169 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1170 - static struct svc_xprt *svc_bc_create_socket(struct svc_serv *, int, 1171 - struct net *, struct sockaddr *, 1172 - int, int); 1173 - static void svc_bc_sock_free(struct svc_xprt *xprt); 1174 - 1175 - static struct svc_xprt *svc_bc_tcp_create(struct svc_serv *serv, 1176 - struct net *net, 1177 - struct sockaddr *sa, int salen, 1178 - int flags) 1179 - { 1180 - return svc_bc_create_socket(serv, IPPROTO_TCP, net, sa, salen, flags); 1181 - } 1182 - 1183 - static void svc_bc_tcp_sock_detach(struct svc_xprt *xprt) 1184 - { 1185 - } 1186 - 1187 - static const struct svc_xprt_ops svc_tcp_bc_ops = { 1188 - .xpo_create = svc_bc_tcp_create, 1189 - .xpo_detach = svc_bc_tcp_sock_detach, 1190 - .xpo_free = svc_bc_sock_free, 1191 - .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, 1192 - .xpo_secure_port = svc_sock_secure_port, 1193 - }; 1194 - 1195 - static struct svc_xprt_class svc_tcp_bc_class = { 1196 - .xcl_name = "tcp-bc", 1197 - .xcl_owner = THIS_MODULE, 1198 - .xcl_ops = &svc_tcp_bc_ops, 1199 - .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP, 1200 - }; 1201 - 1202 - static void svc_init_bc_xprt_sock(void) 1203 - { 1204 - svc_reg_xprt_class(&svc_tcp_bc_class); 1205 - } 1206 - 1207 - static void svc_cleanup_bc_xprt_sock(void) 1208 - { 1209 - svc_unreg_xprt_class(&svc_tcp_bc_class); 1210 - } 1211 - #else /* CONFIG_SUNRPC_BACKCHANNEL */ 1212 - static void svc_init_bc_xprt_sock(void) 1213 - { 1214 - } 1215 - 1216 - static void svc_cleanup_bc_xprt_sock(void) 1217 - { 1218 - } 1219 - #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 1220 - 1221 1192 static const struct svc_xprt_ops svc_tcp_ops = { 1222 1193 .xpo_create = svc_tcp_create, 1223 1194 .xpo_recvfrom = svc_tcp_recvfrom, ··· 1173 1248 .xpo_release_rqst = svc_release_skb, 1174 1249 .xpo_detach = svc_tcp_sock_detach, 1175 1250 .xpo_free = svc_sock_free, 1176 - .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, 1177 1251 .xpo_has_wspace = svc_tcp_has_wspace, 1178 1252 .xpo_accept = svc_tcp_accept, 1179 1253 .xpo_secure_port = svc_sock_secure_port, ··· 1191 1267 { 1192 1268 svc_reg_xprt_class(&svc_tcp_class); 1193 1269 svc_reg_xprt_class(&svc_udp_class); 1194 - svc_init_bc_xprt_sock(); 1195 1270 } 1196 1271 1197 1272 void svc_cleanup_xprt_sock(void) 1198 1273 { 1199 1274 svc_unreg_xprt_class(&svc_tcp_class); 1200 1275 svc_unreg_xprt_class(&svc_udp_class); 1201 - svc_cleanup_bc_xprt_sock(); 1202 1276 } 1203 1277 1204 1278 static void svc_tcp_init(struct svc_sock *svsk, struct svc_serv *serv) ··· 1517 1595 sock_release(svsk->sk_sock); 1518 1596 kfree(svsk); 1519 1597 } 1520 - 1521 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1522 - /* 1523 - * Create a back channel svc_xprt which shares the fore channel socket. 1524 - */ 1525 - static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv, 1526 - int protocol, 1527 - struct net *net, 1528 - struct sockaddr *sin, int len, 1529 - int flags) 1530 - { 1531 - struct svc_sock *svsk; 1532 - struct svc_xprt *xprt; 1533 - 1534 - if (protocol != IPPROTO_TCP) { 1535 - printk(KERN_WARNING "svc: only TCP sockets" 1536 - " supported on shared back channel\n"); 1537 - return ERR_PTR(-EINVAL); 1538 - } 1539 - 1540 - svsk = kzalloc(sizeof(*svsk), GFP_KERNEL); 1541 - if (!svsk) 1542 - return ERR_PTR(-ENOMEM); 1543 - 1544 - xprt = &svsk->sk_xprt; 1545 - svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv); 1546 - set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags); 1547 - 1548 - serv->sv_bc_xprt = xprt; 1549 - 1550 - return xprt; 1551 - } 1552 - 1553 - /* 1554 - * Free a back channel svc_sock. 1555 - */ 1556 - static void svc_bc_sock_free(struct svc_xprt *xprt) 1557 - { 1558 - if (xprt) 1559 - kfree(container_of(xprt, struct svc_sock, sk_xprt)); 1560 - } 1561 - #endif /* CONFIG_SUNRPC_BACKCHANNEL */
-20
net/sunrpc/xprtrdma/backchannel.c
··· 114 114 } 115 115 116 116 /** 117 - * xprt_rdma_bc_up - Create transport endpoint for backchannel service 118 - * @serv: server endpoint 119 - * @net: network namespace 120 - * 121 - * The "xprt" is an implied argument: it supplies the name of the 122 - * backchannel transport class. 123 - * 124 - * Returns zero on success, negative errno on failure 125 - */ 126 - int xprt_rdma_bc_up(struct svc_serv *serv, struct net *net) 127 - { 128 - int ret; 129 - 130 - ret = svc_create_xprt(serv, "rdma-bc", net, PF_INET, 0, 0); 131 - if (ret < 0) 132 - return ret; 133 - return 0; 134 - } 135 - 136 - /** 137 117 * xprt_rdma_bc_maxpayload - Return maximum backchannel message size 138 118 * @xprt: transport 139 119 *
-6
net/sunrpc/xprtrdma/svc_rdma.c
··· 235 235 unregister_sysctl_table(svcrdma_table_header); 236 236 svcrdma_table_header = NULL; 237 237 } 238 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 239 - svc_unreg_xprt_class(&svc_rdma_bc_class); 240 - #endif 241 238 svc_unreg_xprt_class(&svc_rdma_class); 242 239 } 243 240 ··· 256 259 257 260 /* Register RDMA with the SVC transport switch */ 258 261 svc_reg_xprt_class(&svc_rdma_class); 259 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 260 - svc_reg_xprt_class(&svc_rdma_bc_class); 261 - #endif 262 262 return 0; 263 263 }
+63
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
··· 485 485 return p; 486 486 } 487 487 488 + /* RPC-over-RDMA Version One private extension: Remote Invalidation. 489 + * Responder's choice: requester signals it can handle Send With 490 + * Invalidate, and responder chooses one R_key to invalidate. 491 + * 492 + * If there is exactly one distinct R_key in the received transport 493 + * header, set rc_inv_rkey to that R_key. Otherwise, set it to zero. 494 + * 495 + * Perform this operation while the received transport header is 496 + * still in the CPU cache. 497 + */ 498 + static void svc_rdma_get_inv_rkey(struct svcxprt_rdma *rdma, 499 + struct svc_rdma_recv_ctxt *ctxt) 500 + { 501 + __be32 inv_rkey, *p; 502 + u32 i, segcount; 503 + 504 + ctxt->rc_inv_rkey = 0; 505 + 506 + if (!rdma->sc_snd_w_inv) 507 + return; 508 + 509 + inv_rkey = xdr_zero; 510 + p = ctxt->rc_recv_buf; 511 + p += rpcrdma_fixed_maxsz; 512 + 513 + /* Read list */ 514 + while (*p++ != xdr_zero) { 515 + p++; /* position */ 516 + if (inv_rkey == xdr_zero) 517 + inv_rkey = *p; 518 + else if (inv_rkey != *p) 519 + return; 520 + p += 4; 521 + } 522 + 523 + /* Write list */ 524 + while (*p++ != xdr_zero) { 525 + segcount = be32_to_cpup(p++); 526 + for (i = 0; i < segcount; i++) { 527 + if (inv_rkey == xdr_zero) 528 + inv_rkey = *p; 529 + else if (inv_rkey != *p) 530 + return; 531 + p += 4; 532 + } 533 + } 534 + 535 + /* Reply chunk */ 536 + if (*p++ != xdr_zero) { 537 + segcount = be32_to_cpup(p++); 538 + for (i = 0; i < segcount; i++) { 539 + if (inv_rkey == xdr_zero) 540 + inv_rkey = *p; 541 + else if (inv_rkey != *p) 542 + return; 543 + p += 4; 544 + } 545 + } 546 + 547 + ctxt->rc_inv_rkey = be32_to_cpu(inv_rkey); 548 + } 549 + 488 550 /* On entry, xdr->head[0].iov_base points to first byte in the 489 551 * RPC-over-RDMA header. 490 552 * ··· 808 746 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); 809 747 return ret; 810 748 } 749 + svc_rdma_get_inv_rkey(rdma_xprt, ctxt); 811 750 812 751 p += rpcrdma_fixed_maxsz; 813 752 if (*p != xdr_zero)
+13 -44
net/sunrpc/xprtrdma/svc_rdma_sendto.c
··· 484 484 *reply = NULL; 485 485 } 486 486 487 - /* RPC-over-RDMA Version One private extension: Remote Invalidation. 488 - * Responder's choice: requester signals it can handle Send With 489 - * Invalidate, and responder chooses one rkey to invalidate. 490 - * 491 - * Find a candidate rkey to invalidate when sending a reply. Picks the 492 - * first R_key it finds in the chunk lists. 493 - * 494 - * Returns zero if RPC's chunk lists are empty. 495 - */ 496 - static u32 svc_rdma_get_inv_rkey(__be32 *rdma_argp, 497 - __be32 *wr_lst, __be32 *rp_ch) 498 - { 499 - __be32 *p; 500 - 501 - p = rdma_argp + rpcrdma_fixed_maxsz; 502 - if (*p != xdr_zero) 503 - p += 2; 504 - else if (wr_lst && be32_to_cpup(wr_lst + 1)) 505 - p = wr_lst + 2; 506 - else if (rp_ch && be32_to_cpup(rp_ch + 1)) 507 - p = rp_ch + 2; 508 - else 509 - return 0; 510 - return be32_to_cpup(p); 511 - } 512 - 513 487 static int svc_rdma_dma_map_page(struct svcxprt_rdma *rdma, 514 488 struct svc_rdma_send_ctxt *ctxt, 515 489 struct page *page, ··· 646 672 * 647 673 * RDMA Send is the last step of transmitting an RPC reply. Pages 648 674 * involved in the earlier RDMA Writes are here transferred out 649 - * of the rqstp and into the ctxt's page array. These pages are 675 + * of the rqstp and into the sctxt's page array. These pages are 650 676 * DMA unmapped by each Write completion, but the subsequent Send 651 677 * completion finally releases these pages. 652 678 * ··· 654 680 * - The Reply's transport header will never be larger than a page. 655 681 */ 656 682 static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, 657 - struct svc_rdma_send_ctxt *ctxt, 658 - __be32 *rdma_argp, 683 + struct svc_rdma_send_ctxt *sctxt, 684 + struct svc_rdma_recv_ctxt *rctxt, 659 685 struct svc_rqst *rqstp, 660 686 __be32 *wr_lst, __be32 *rp_ch) 661 687 { 662 688 int ret; 663 689 664 690 if (!rp_ch) { 665 - ret = svc_rdma_map_reply_msg(rdma, ctxt, 691 + ret = svc_rdma_map_reply_msg(rdma, sctxt, 666 692 &rqstp->rq_res, wr_lst); 667 693 if (ret < 0) 668 694 return ret; 669 695 } 670 696 671 - svc_rdma_save_io_pages(rqstp, ctxt); 697 + svc_rdma_save_io_pages(rqstp, sctxt); 672 698 673 - ctxt->sc_send_wr.opcode = IB_WR_SEND; 674 - if (rdma->sc_snd_w_inv) { 675 - ctxt->sc_send_wr.ex.invalidate_rkey = 676 - svc_rdma_get_inv_rkey(rdma_argp, wr_lst, rp_ch); 677 - if (ctxt->sc_send_wr.ex.invalidate_rkey) 678 - ctxt->sc_send_wr.opcode = IB_WR_SEND_WITH_INV; 699 + if (rctxt->rc_inv_rkey) { 700 + sctxt->sc_send_wr.opcode = IB_WR_SEND_WITH_INV; 701 + sctxt->sc_send_wr.ex.invalidate_rkey = rctxt->rc_inv_rkey; 702 + } else { 703 + sctxt->sc_send_wr.opcode = IB_WR_SEND; 679 704 } 680 705 dprintk("svcrdma: posting Send WR with %u sge(s)\n", 681 - ctxt->sc_send_wr.num_sge); 682 - return svc_rdma_send(rdma, &ctxt->sc_send_wr); 706 + sctxt->sc_send_wr.num_sge); 707 + return svc_rdma_send(rdma, &sctxt->sc_send_wr); 683 708 } 684 709 685 710 /* Given the client-provided Write and Reply chunks, the server was not ··· 712 739 } 713 740 714 741 return 0; 715 - } 716 - 717 - void svc_rdma_prep_reply_hdr(struct svc_rqst *rqstp) 718 - { 719 742 } 720 743 721 744 /** ··· 778 809 } 779 810 780 811 svc_rdma_sync_reply_hdr(rdma, sctxt, svc_rdma_reply_hdr_len(rdma_resp)); 781 - ret = svc_rdma_send_reply_msg(rdma, sctxt, rdma_argp, rqstp, 812 + ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp, 782 813 wr_lst, rp_ch); 783 814 if (ret < 0) 784 815 goto err1;
-59
net/sunrpc/xprtrdma/svc_rdma_transport.c
··· 85 85 .xpo_release_rqst = svc_rdma_release_rqst, 86 86 .xpo_detach = svc_rdma_detach, 87 87 .xpo_free = svc_rdma_free, 88 - .xpo_prep_reply_hdr = svc_rdma_prep_reply_hdr, 89 88 .xpo_has_wspace = svc_rdma_has_wspace, 90 89 .xpo_accept = svc_rdma_accept, 91 90 .xpo_secure_port = svc_rdma_secure_port, ··· 98 99 .xcl_max_payload = RPCSVC_MAXPAYLOAD_RDMA, 99 100 .xcl_ident = XPRT_TRANSPORT_RDMA, 100 101 }; 101 - 102 - #if defined(CONFIG_SUNRPC_BACKCHANNEL) 103 - static struct svc_xprt *svc_rdma_bc_create(struct svc_serv *, struct net *, 104 - struct sockaddr *, int, int); 105 - static void svc_rdma_bc_detach(struct svc_xprt *); 106 - static void svc_rdma_bc_free(struct svc_xprt *); 107 - 108 - static const struct svc_xprt_ops svc_rdma_bc_ops = { 109 - .xpo_create = svc_rdma_bc_create, 110 - .xpo_detach = svc_rdma_bc_detach, 111 - .xpo_free = svc_rdma_bc_free, 112 - .xpo_prep_reply_hdr = svc_rdma_prep_reply_hdr, 113 - .xpo_secure_port = svc_rdma_secure_port, 114 - }; 115 - 116 - struct svc_xprt_class svc_rdma_bc_class = { 117 - .xcl_name = "rdma-bc", 118 - .xcl_owner = THIS_MODULE, 119 - .xcl_ops = &svc_rdma_bc_ops, 120 - .xcl_max_payload = (1024 - RPCRDMA_HDRLEN_MIN) 121 - }; 122 - 123 - static struct svc_xprt *svc_rdma_bc_create(struct svc_serv *serv, 124 - struct net *net, 125 - struct sockaddr *sa, int salen, 126 - int flags) 127 - { 128 - struct svcxprt_rdma *cma_xprt; 129 - struct svc_xprt *xprt; 130 - 131 - cma_xprt = svc_rdma_create_xprt(serv, net); 132 - if (!cma_xprt) 133 - return ERR_PTR(-ENOMEM); 134 - xprt = &cma_xprt->sc_xprt; 135 - 136 - svc_xprt_init(net, &svc_rdma_bc_class, xprt, serv); 137 - set_bit(XPT_CONG_CTRL, &xprt->xpt_flags); 138 - serv->sv_bc_xprt = xprt; 139 - 140 - dprintk("svcrdma: %s(%p)\n", __func__, xprt); 141 - return xprt; 142 - } 143 - 144 - static void svc_rdma_bc_detach(struct svc_xprt *xprt) 145 - { 146 - dprintk("svcrdma: %s(%p)\n", __func__, xprt); 147 - } 148 - 149 - static void svc_rdma_bc_free(struct svc_xprt *xprt) 150 - { 151 - struct svcxprt_rdma *rdma = 152 - container_of(xprt, struct svcxprt_rdma, sc_xprt); 153 - 154 - dprintk("svcrdma: %s(%p)\n", __func__, xprt); 155 - if (xprt) 156 - kfree(rdma); 157 - } 158 - #endif /* CONFIG_SUNRPC_BACKCHANNEL */ 159 102 160 103 /* QP event handler */ 161 104 static void qp_event_handler(struct ib_event *event, void *context)
-1
net/sunrpc/xprtrdma/transport.c
··· 827 827 .inject_disconnect = xprt_rdma_inject_disconnect, 828 828 #if defined(CONFIG_SUNRPC_BACKCHANNEL) 829 829 .bc_setup = xprt_rdma_bc_setup, 830 - .bc_up = xprt_rdma_bc_up, 831 830 .bc_maxpayload = xprt_rdma_bc_maxpayload, 832 831 .bc_free_rqst = xprt_rdma_bc_free_rqst, 833 832 .bc_destroy = xprt_rdma_bc_destroy,
-1
net/sunrpc/xprtrdma/xprt_rdma.h
··· 661 661 */ 662 662 #if defined(CONFIG_SUNRPC_BACKCHANNEL) 663 663 int xprt_rdma_bc_setup(struct rpc_xprt *, unsigned int); 664 - int xprt_rdma_bc_up(struct svc_serv *, struct net *); 665 664 size_t xprt_rdma_bc_maxpayload(struct rpc_xprt *); 666 665 int rpcrdma_bc_post_recv(struct rpcrdma_xprt *, unsigned int); 667 666 void rpcrdma_bc_receive_call(struct rpcrdma_xprt *, struct rpcrdma_rep *);
-12
net/sunrpc/xprtsock.c
··· 1400 1400 } 1401 1401 1402 1402 #if defined(CONFIG_SUNRPC_BACKCHANNEL) 1403 - static int xs_tcp_bc_up(struct svc_serv *serv, struct net *net) 1404 - { 1405 - int ret; 1406 - 1407 - ret = svc_create_xprt(serv, "tcp-bc", net, PF_INET, 0, 1408 - SVC_SOCK_ANONYMOUS); 1409 - if (ret < 0) 1410 - return ret; 1411 - return 0; 1412 - } 1413 - 1414 1403 static size_t xs_tcp_bc_maxpayload(struct rpc_xprt *xprt) 1415 1404 { 1416 1405 return PAGE_SIZE; ··· 2654 2665 .inject_disconnect = xs_inject_disconnect, 2655 2666 #ifdef CONFIG_SUNRPC_BACKCHANNEL 2656 2667 .bc_setup = xprt_setup_bc, 2657 - .bc_up = xs_tcp_bc_up, 2658 2668 .bc_maxpayload = xs_tcp_bc_maxpayload, 2659 2669 .bc_free_rqst = xprt_free_bc_rqst, 2660 2670 .bc_destroy = xprt_destroy_bc,