Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svc_xprt_lookup - Add extra ref on create #155

Merged
merged 1 commit into from Oct 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
svc_xprt_lookup - Add extra ref on create
An xprt has a ref for the hash table (that's released by SVC_DESTROY());
but when it's first created, only 1 ref was taken, so there wasn't a ref
for the caller.

Add an extra ref for the caller when the xprt is first created.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
  • Loading branch information
dang committed Oct 22, 2018
commit ca74cde10ef02a322b8944a6c8639b1318fa34dc
3 changes: 3 additions & 0 deletions src/svc_xprt.c
Expand Up @@ -174,6 +174,9 @@ svc_xprt_lookup(int fd, svc_xprt_setup_t setup)
xprt->xp_fd = fd;
xprt->xp_flags = SVC_XPRT_FLAG_INITIAL;

/* Get ref for caller */
SVC_REF(xprt, SVC_REF_FLAG_NONE);

rec = REC_XPRT(xprt);
rpc_dplx_rli(rec);
if (opr_rbtree_insert(&t->t, &rec->fd_node)) {
Expand Down