<div dir="ltr">Reviewed-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/9 Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">After queue_peer_request(), request might be released, so move stat_request_begin<br>
ahead of request handling to avoid possible NULL deferencec.<br>
<br>
Reported-by: Marcin Mirosław <<a href="mailto:marcin@mejor.pl">marcin@mejor.pl</a>><br>
Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
---<br>
 sheep/request.c | 3 +--<br>
 1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/sheep/request.c b/sheep/request.c<br>
index 9f3f110..161b7db 100644<br>
--- a/sheep/request.c<br>
+++ b/sheep/request.c<br>
@@ -474,7 +474,7 @@ static void queue_request(struct request *req)<br>
        }<br>
<br>
        req->vinfo = get_vnode_info();<br>
-<br>
+       stat_request_begin(req);<br>
        if (is_peer_op(req->op)) {<br>
                queue_peer_request(req);<br>
        } else if (is_gateway_op(req->op)) {<br>
@@ -491,7 +491,6 @@ static void queue_request(struct request *req)<br>
                rsp->result = SD_RES_SYSTEM_ERROR;<br>
                goto done;<br>
        }<br>
-       stat_request_begin(req);<br>
<br>
        return;<br>
 done:<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.2<br>
<br>
--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<br>Best Regard<br>Robin Dong
</div>