<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">2013/12/3 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">Since cluster_info support copy_policy now, we can return system wide<br>
copy_policy for get_vdi_copy_policy() if vdi is not found.<br>
<br>
Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
---<br>
 sheep/vdi.c |    8 +++++---<br>
 1 file changed, 5 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/sheep/vdi.c b/sheep/vdi.c<br>
index 60bc52d..90f1c70 100644<br>
--- a/sheep/vdi.c<br>
+++ b/sheep/vdi.c<br>
@@ -112,9 +112,11 @@ int get_vdi_copy_policy(uint32_t vid)<br>
        entry = vdi_state_search(&vdi_state_root, vid);<br>
        sd_unlock(&vdi_state_lock);<br>
<br>
-       if (!entry)<br>
-               /* If not found, it must be non-erasure object */<br>
-               return 0;<br>
+       if (!entry) {<br>
+               sd_alert("copy policy for %" PRIx32 " not found, set %d", vid,<br>
+                        sys->cinfo.copy_policy);<br>
+               return sys->cinfo.copy_policy;<br>
+       }<br>
<br>
        return entry->copy_policy;<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<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>