glusterd: Add GF_ASSERT check in glusterd volume op handlers
Change-Id: Iea6ac1e612812ba8ffc4b60899a9e574a3b09ea6 BUG: 873549 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/4346 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
parent
386031c784
commit
61905d6418
@ -571,6 +571,7 @@ glusterd_handle_remove_brick (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req,
|
||||
(xdrproc_t)xdr_gf_cli_req);
|
||||
|
@ -52,11 +52,11 @@ glusterd_handle_gsync_set (rpcsvc_request_t *req)
|
||||
xlator_t *this = NULL;
|
||||
|
||||
GF_ASSERT (req);
|
||||
GF_ASSERT (THIS);
|
||||
GF_ASSERT (THIS->private);
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
priv = this->private;
|
||||
GF_ASSERT (priv);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req,
|
||||
(xdrproc_t)xdr_gf_cli_req);
|
||||
|
@ -458,6 +458,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx,
|
||||
GF_ASSERT (NULL != ctx);
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
priv = this->private;
|
||||
GF_ASSERT (priv);
|
||||
|
||||
@ -1198,6 +1199,7 @@ glusterd_handle_reset_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
@ -1268,6 +1270,7 @@ glusterd_handle_set_volume (rpcsvc_request_t *req)
|
||||
xlator_t *this = NULL;
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
GF_ASSERT (req);
|
||||
|
||||
@ -1368,6 +1371,7 @@ glusterd_handle_sync_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
@ -2061,6 +2065,7 @@ glusterd_handle_cli_profile_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
@ -2898,6 +2903,7 @@ glusterd_handle_status_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
@ -2973,6 +2979,7 @@ glusterd_handle_cli_clearlocks_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = -1;
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
|
@ -36,6 +36,7 @@ glusterd_handle_log_rotate (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
|
@ -39,6 +39,7 @@ glusterd_handle_quota (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
|
@ -389,8 +389,10 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
priv = this->private;
|
||||
GF_ASSERT (priv);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
|
@ -85,6 +85,7 @@ glusterd_handle_replace_brick (rpcsvc_request_t *req)
|
||||
|
||||
GF_ASSERT (req);
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
if (ret < 0) {
|
||||
|
@ -235,6 +235,7 @@ glusterd_handle_cli_start_volume (rpcsvc_request_t *req)
|
||||
xlator_t *this = NULL;
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
GF_ASSERT (req);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
@ -303,6 +304,7 @@ glusterd_handle_cli_stop_volume (rpcsvc_request_t *req)
|
||||
char err_str[2048] = {0,};
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
GF_ASSERT (req);
|
||||
|
||||
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
|
||||
@ -374,6 +376,7 @@ glusterd_handle_cli_delete_volume (rpcsvc_request_t *req)
|
||||
xlator_t *this = NULL;
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
GF_ASSERT (req);
|
||||
|
||||
@ -457,6 +460,7 @@ glusterd_handle_cli_heal_volume (rpcsvc_request_t *req)
|
||||
}
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
if (cli_req.dict.dict_len) {
|
||||
/* Unserialize the dictionary */
|
||||
@ -538,6 +542,7 @@ glusterd_handle_cli_statedump_volume (rpcsvc_request_t *req)
|
||||
xlator_t *this = NULL;
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT (this);
|
||||
|
||||
GF_ASSERT (req);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user