<br><br>
<div class="gmail_quote">On Thu, May 3, 2012 at 3:06 PM, Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div class="im">On 05/03/2012 02:16 PM, <a href="mailto:tao.peng@emc.com">tao.peng@emc.com</a> wrote:<br><br></div>
<div class="im">> Hi list,<br>><br>> I was reading sheepdog code and noticed that in update_vnode_info(),<br>> if one thread calls get_vnode_info() between<br>> put_vnode_info(current_vnode_info) and current_vnode_info =<br>
> vnode_info, it then will get an invalid pointer. So it looks like a<br>> race window there?<br>><br>> Best, Tao<br><br><br></div>Oops, it seems that we have brought in a big monster, we don't have any<br>
lock mechanism to protect current_vnode_info, which is referenced and<br>calculated by worker threads and main thread scattered everywhere in the<br>code and it is really a dilemma to introduce such a ubiquitous lock<br>between worker and main threads.<br>
</blockquote>
<div> </div>
<div>current_vnode_info only be changed when epoch changes. Before using the current_vnode_info, the vnode cache is allocated and freed frequently. When the reference counter beacomes zero, the cache will be freed even without epoch changes. There is also race conditions, although it is not frequent.  </div>

<div> </div>
<div>Thanks</div>
<div>Haiti</div>
<div> </div>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><br>Should we revert the patch introduce current_vnode_info?<br><br>Thanks,<br>Yuan<br>
<div class="HOEnZb">
<div class="h5"><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>
</div></div></blockquote></div><br>