Project

General

Profile

Bug #4462

clnt_vc_control()/clnt_dg_control() could return RPC_FAILED instead of FALSE

Added by Marcel Telka almost 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2014-01-13
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Both clnt_vc_control() and clnt_dg_control() could return RPC_FAILED instead of FALSE here:

876clnt_vc_control(CLIENT *cl, int request, char *info)
877{
878    bool_t ret;
879/* LINTED pointer alignment */
880    struct ct_data *ct = (struct ct_data *)cl->cl_private;
881
882    if (rpc_fd_lock(vctbl, ct->ct_fd)) {
883        rpc_fd_unlock(vctbl, ct->ct_fd);
884        return (RPC_FAILED);
885    }
711static bool_t
712clnt_dg_control(CLIENT *cl, int request, char *info)
713{
714/* LINTED pointer alignment */
715    struct cu_data *cu = (struct cu_data *)cl->cl_private;
716    struct netbuf *addr;
717    if (rpc_fd_lock(dgtbl, cu->cu_fd)) {
718        rpc_fd_unlock(dgtbl, cu->cu_fd);
719        return (RPC_FAILED);
720    }

History

#1

Updated by Marcel Telka almost 6 years ago

Both clnt_vc_control() and clnt_dg_control() are internal implementation of clnt_control(3nsl). The clnt_control(3nsl) should return TRUE (success) or FALSE (failure).

The problem is that RPC_FAILED (with value 16) is returned here on failure. So the return value is both invalid and confusing.

#2

Updated by Marcel Telka over 5 years ago

  • Assignee set to Marcel Telka
#3

Updated by Marcel Telka over 5 years ago

  • Status changed from New to In Progress
#4

Updated by Marcel Telka over 5 years ago

  • Status changed from In Progress to Pending RTI
#5

Updated by Electric Monk over 5 years ago

git commit 5131caa123fd046a511d18145869507ae9b7b9dd

Author: Marcel Telka <marcel.telka@nexenta.com>

4462 clnt_vc_control()/clnt_dg_control() could return RPC_FAILED instead of FALSE
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>

#6

Updated by Marcel Telka over 5 years ago

  • Status changed from Pending RTI to Resolved
  • Tags deleted (needs-triage)

Also available in: Atom PDF