Something like this: (not tested at all)<div><br></div><div><div>diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c</div><div>index 4d8d326..0f8322f 100644</div><div>--- a/xlators/cluster/dht/src/dht-common.c</div>
<div>+++ b/xlators/cluster/dht/src/dht-common.c</div><div>@@ -191,7 +191,7 @@ dht_discover_complete (xlator_t *this, call_frame_t *discover_frame)</div><div>                                 &quot;ENOENT errors: %d)&quot;, local-&gt;loc.path,</div>
<div>                                 (ret &lt; 0) ? &quot;yes&quot; : &quot;no&quot;, (ret &gt; 0) ? ret : 0);</div><div>                         op_errno = EINVAL;</div><div>-                        goto out;</div><div>
+                        goto selfheal;</div><div>                 }</div><div> </div><div>                 dht_layout_set (this, local-&gt;inode, layout);</div><div>@@ -206,6 +206,12 @@ out:</div><div>                           NULL);</div>
<div> </div><div>         return ret;</div><div>+selfheal:</div><div>+        FRAME_SU_DO (frame, dht_local_t);</div><div>+        uuid_copy (local-&gt;loc.gfid, local-&gt;gfid);</div><div>+        ret = dht_selfheal_directory (frame, dht_lookup_selfheal_cbk,</div>
<div>+                                      &amp;local-&gt;loc, layout);</div><div>+       return 0;</div><div> }</div><div><br></div><div><br></div><div>Inside dht_selfheal_directory and beyond we would need changes to make it work specially for nameless loc_t where it would not try to create missing dirs but only fix layout.</div>
<div><br></div><div>All this is necessary only for fixing 1-brick -&gt; 2-brick kind of add-brick (which should be broken even on Linux now)</div><div><br></div><div>Avati</div><br><div class="gmail_quote">On Mon, Aug 20, 2012 at 12:38 AM, Emmanuel Dreyfus <span dir="ltr">&lt;<a href="mailto:manu@netbsd.org" target="_blank">manu@netbsd.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, Aug 19, 2012 at 06:38:48AM -0700, Anand Avati wrote:<br>
&gt; I now realize that if you re-refer an inode before it is timed out in the<br>
&gt; kernel (and LOOKUP is sent), then the code path<br>
&gt; hitting fuse_resolve_gfid_cbk might reach this. We need to call<br>
&gt; dht_self_heal in dht_discover_cbk if layout requires healing.<br>
<br>
</div>There are many flavors of dht_selfheal_*(), the change is not<br>
straightforward.  Would you have a patch (even untested, just to<br>
give the direction)?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Emmanuel Dreyfus<br>
<a href="mailto:manu@netbsd.org">manu@netbsd.org</a><br>
</font></span></blockquote></div><br></div>