<div dir="ltr">loc->name will be something like "file-1@vol1-dht:vol1-client-0"<div>key will be something like "@vol1-dht:vol1-client-0"</div><div>name_len will be strlen of file-1 (strlen("file-1@vol1-dht:vol1-client-0") - strlen(@vol1-dht:vol1-client-0))</div><div><br></div><div>We are therefore writing the filename part of the loc->name into new_name because that is the actual filename that we want created. The rest of the loc->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 <<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a>> 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'm reading the function, and unsure what's going on there, perhaps I'm missing something:</div>name_len = strlen(loc->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, "%s", loc->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->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>