<div dir="ltr">loc-&gt;name will be something like &quot;file-1@vol1-dht:vol1-client-0&quot;<div>key will be something like &quot;@vol1-dht:vol1-client-0&quot;</div><div>name_len will be strlen of file-1   (strlen(&quot;file-1@vol1-dht:vol1-client-0&quot;) - strlen(@vol1-dht:vol1-client-0))</div><div><br></div><div>We are therefore writing the filename part of the loc-&gt;name into new_name because that is the actual filename that we want created. The rest of the loc-&gt;name holds the key value which refers to the dht subvol on which we want the file created.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Regards,</div><div>Nithya</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 4 Oct 2019 at 13:23, Yaniv Kaul &lt;<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I&#39;m reading the function, and unsure what&#39;s going on there, perhaps I&#39;m missing something:</div>name_len = strlen(loc-&gt;name) - keylen;<br><div>new_name = GF_MALLOC(name_len + 1, gf_common_mt_char);</div><div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">snprintf(new_name, name_len + 1, &quot;%s&quot;, loc-&gt;name);</div></div><div><br></div><div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">How exactly is there enough space to snprintf loc-&gt;name into new_name?</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Y.</div><br></div></div>
_______________________________________________<br>
<br>
Community Meeting Calendar:<br>
<br>
APAC Schedule -<br>
Every 2nd and 4th Tuesday at 11:30 AM IST<br>
Bridge: <a href="https://bluejeans.com/118564314" rel="noreferrer" target="_blank">https://bluejeans.com/118564314</a><br>
<br>
NA/EMEA Schedule -<br>
Every 1st and 3rd Tuesday at 01:00 PM EDT<br>
Bridge: <a href="https://bluejeans.com/118564314" rel="noreferrer" target="_blank">https://bluejeans.com/118564314</a><br>
<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="https://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">https://lists.gluster.org/mailman/listinfo/gluster-devel</a><br>
<br>
</blockquote></div>