diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-04-10 17:12:01 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-17 05:46:43 -0700 | 
| commit | 47c118e22d9d6fb6662fe96841ed4fe3089739b5 (patch) | |
| tree | 2d1e7c02f04fd0a29316ac124cb4f8fe4ea773ed /rpc/rpc-lib/src | |
| parent | 1787debc1b6640e15a02ccac4699b92affb2bb14 (diff) | |
glusterd: Fixed spurious wakeups in glusterd syncops
glusterd syncops perform a barrier_wake whenever rpc_clnt_submit returned -1.
This is based on the wrong assumption that the cbkfn wasn't called.
This would result in one more wakeup than there ought to be.
BUG: 948686
Change-Id: I839fd218a81255fe50c2047d67461d45360e894d
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4834
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src')
| -rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 36 | ||||
| -rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.h | 9 | 
2 files changed, 38 insertions, 7 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index e6c681df8f3..a27d0479193 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1384,13 +1384,14 @@ out:  int -rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, -                 int procnum, fop_cbk_fn_t cbkfn, -                 struct iovec *proghdr, int proghdrcount, -                 struct iovec *progpayload, int progpayloadcount, -                 struct iobref *iobref, void *frame, struct iovec *rsphdr, -                 int rsphdr_count, struct iovec *rsp_payload, -                 int rsp_payload_count, struct iobref *rsp_iobref) +rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, +                  int procnum, fop_cbk_fn_t cbkfn, +                  struct iovec *proghdr, int proghdrcount, +                  struct iovec *progpayload, int progpayloadcount, +                  struct iobref *iobref, void *frame, struct iovec *rsphdr, +                  int rsphdr_count, struct iovec *rsp_payload, +                  int rsp_payload_count, struct iobref *rsp_iobref, +                  gf_boolean_t *lost)  {          rpc_clnt_connection_t *conn        = NULL;          struct iobuf          *request_iob = NULL; @@ -1401,6 +1402,7 @@ rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog,          int                    proglen     = 0;          char                   new_iobref  = 0;          uint64_t               callid      = 0; +        gf_boolean_t           cbk_lost    = _gf_true;          if (!rpc || !prog || !frame) {                  goto out; @@ -1489,6 +1491,7 @@ rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog,                  if ((ret >= 0) && frame) {                          /* Save the frame in queue */ +                        cbk_lost = _gf_false;                          __save_frame (rpc, frame, rpcreq);                          gf_log ("rpc-clnt", GF_LOG_TRACE, "submitted request " @@ -1519,12 +1522,31 @@ out:                  if (rpcreq) {                          rpcreq->rpc_status = -1;                          cbkfn (rpcreq, NULL, 0, frame); +                        cbk_lost = _gf_false;                          mem_put (rpcreq);                  }          } +        if (lost) +                *lost = cbk_lost;          return ret;  } +int +rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, +                 int procnum, fop_cbk_fn_t cbkfn, +                 struct iovec *proghdr, int proghdrcount, +                 struct iovec *progpayload, int progpayloadcount, +                 struct iobref *iobref, void *frame, struct iovec *rsphdr, +                 int rsphdr_count, struct iovec *rsp_payload, +                 int rsp_payload_count, struct iobref *rsp_iobref) +{ +        return rpc_clnt_submit2 (rpc, prog, procnum, cbkfn, proghdr, +                                 proghdrcount, progpayload, progpayloadcount, +                                 iobref, frame, rsphdr, rsphdr_count, +                                 rsp_payload, rsp_payload_count, rsp_iobref, +                                 NULL); +} +  struct rpc_clnt *  rpc_clnt_ref (struct rpc_clnt *rpc) diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h index 0da1655590a..34612fcc452 100644 --- a/rpc/rpc-lib/src/rpc-clnt.h +++ b/rpc/rpc-lib/src/rpc-clnt.h @@ -216,6 +216,15 @@ int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog,                       int rsphdr_count, struct iovec *rsp_payload,                       int rsp_payload_count, struct iobref *rsp_iobref); +int rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, +                     int procnum, fop_cbk_fn_t cbkfn, +                     struct iovec *proghdr, int proghdrcount, +                     struct iovec *progpayload, int progpayloadcount, +                     struct iobref *iobref, void *frame, struct iovec *rsphdr, +                     int rsphdr_count, struct iovec *rsp_payload, +                     int rsp_payload_count, struct iobref *rsp_iobref, +                     gf_boolean_t *cbk_lost); +  struct rpc_clnt *  rpc_clnt_ref (struct rpc_clnt *rpc);  | 
