<html><body><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000"><div>In gfapi, we pass down readdirp, irrespective of whether the application called readdir/readdirp.</div><div>Hence the behaviour will be same for samba and Ganesha i suppose.<br></div><div><br></div><div>Regards,<br></div><div>Poornima<br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Pranith Kumar Karampuri" &lt;pkarampu@redhat.com&gt;<br><b>To: </b>"Raghavendra Gowdappa" &lt;rgowdapp@redhat.com&gt;, "Poornima Gurusiddaiah" &lt;pgurusid@redhat.com&gt;, "Raghavendra Talur" &lt;rtalur@redhat.com&gt;, "Soumya Koduri" &lt;skoduri@redhat.com&gt;<br><b>Cc: </b>"Shyam Ranganathan" &lt;srangana@redhat.com&gt;, "Nithya Balachandran" &lt;nbalacha@redhat.com&gt;, "Gluster Devel" &lt;gluster-devel@gluster.org&gt;<br><b>Sent: </b>Friday, September 30, 2016 12:38:06 AM<br><b>Subject: </b>Re: Dht readdir filtering out names<br><div><br></div><div dir="ltr">Does samba/gfapi/nfs-ganesha have options to disable readdirp?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 30, 2016 at 10:04 AM, Pranith Kumar Karampuri <span dir="ltr">&lt;<a href="mailto:pkarampu@redhat.com" target="_blank">pkarampu@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What if the lower xlators want to set the entry-&gt;inode to NULL and clear the entry-&gt;d_stat to force a lookup on the name? i.e. gfid-split-brain/ia_type mismatches. <br></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Sep 30, 2016 at 10:00 AM, Raghavendra Gowdappa <span dir="ltr">&lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
----- Original Message -----<br>
&gt; From: "Raghavendra Gowdappa" &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
&gt; To: "Pranith Kumar Karampuri" &lt;<a href="mailto:pkarampu@redhat.com" target="_blank">pkarampu@redhat.com</a>&gt;<br>
&gt; Cc: "Shyam Ranganathan" &lt;<a href="mailto:srangana@redhat.com" target="_blank">srangana@redhat.com</a>&gt;, "Nithya Balachandran" &lt;<a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;, "Gluster Devel"<br>
&gt; &lt;<a href="mailto:gluster-devel@gluster.org" target="_blank">gluster-devel@gluster.org</a>&gt;<br>
</span><div><div>&gt; Sent: Friday, September 30, 2016 9:58:34 AM<br>
&gt; Subject: Re: Dht readdir filtering out names<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt; &gt; From: "Pranith Kumar Karampuri" &lt;<a href="mailto:pkarampu@redhat.com" target="_blank">pkarampu@redhat.com</a>&gt;<br>
&gt; &gt; To: "Raghavendra Gowdappa" &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
&gt; &gt; Cc: "Shyam Ranganathan" &lt;<a href="mailto:srangana@redhat.com" target="_blank">srangana@redhat.com</a>&gt;, "Nithya Balachandran"<br>
&gt; &gt; &lt;<a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;, "Gluster Devel"<br>
&gt; &gt; &lt;<a href="mailto:gluster-devel@gluster.org" target="_blank">gluster-devel@gluster.org</a>&gt;<br>
&gt; &gt; Sent: Friday, September 30, 2016 9:53:44 AM<br>
&gt; &gt; Subject: Re: Dht readdir filtering out names<br>
&gt; &gt;<br>
&gt; &gt; On Fri, Sep 30, 2016 at 9:50 AM, Raghavendra Gowdappa &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; ----- Original Message -----<br>
&gt; &gt; &gt; &gt; From: "Pranith Kumar Karampuri" &lt;<a href="mailto:pkarampu@redhat.com" target="_blank">pkarampu@redhat.com</a>&gt;<br>
&gt; &gt; &gt; &gt; To: "Raghavendra Gowdappa" &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Cc: "Shyam Ranganathan" &lt;<a href="mailto:srangana@redhat.com" target="_blank">srangana@redhat.com</a>&gt;, "Nithya Balachandran" &lt;<br>
&gt; &gt; &gt; <a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;, "Gluster Devel"<br>
&gt; &gt; &gt; &gt; &lt;<a href="mailto:gluster-devel@gluster.org" target="_blank">gluster-devel@gluster.org</a>&gt;<br>
&gt; &gt; &gt; &gt; Sent: Friday, September 30, 2016 9:15:04 AM<br>
&gt; &gt; &gt; &gt; Subject: Re: Dht readdir filtering out names<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Fri, Sep 30, 2016 at 9:13 AM, Raghavendra Gowdappa &lt;<br>
&gt; &gt; &gt; <a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
&gt; &gt; &gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; dht_readdirp_cbk has different behaviour for directories and files.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; 1. If file, pick the dentry (passed from subvols as part of readdirp<br>
&gt; &gt; &gt; &gt; &gt; response) if the it corresponds to data file.<br>
&gt; &gt; &gt; &gt; &gt; 2. If directory pick the dentry if readdirp response is from<br>
&gt; &gt; &gt; hashed-subvol.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; In all other cases, the dentry is skipped and not passed to higher<br>
&gt; &gt; &gt; &gt; &gt; layers/application. To elaborate, the dentries which are ignored are:<br>
&gt; &gt; &gt; &gt; &gt; 1. dentries corresponding to linkto files.<br>
&gt; &gt; &gt; &gt; &gt; 2. dentries from non-hashed subvols corresponding to directories.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Since the behaviour is different for different filesystem objects,<br>
&gt; &gt; &gt; &gt; &gt; dht<br>
&gt; &gt; &gt; &gt; &gt; needs ia_type to choose its behaviour.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; ----- Original Message -----<br>
&gt; &gt; &gt; &gt; &gt; &gt; From: "Pranith Kumar Karampuri" &lt;<a href="mailto:pkarampu@redhat.com" target="_blank">pkarampu@redhat.com</a>&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; To: "Shyam Ranganathan" &lt;<a href="mailto:srangana@redhat.com" target="_blank">srangana@redhat.com</a>&gt;, "Raghavendra<br>
&gt; &gt; &gt; Gowdappa" &lt;<br>
&gt; &gt; &gt; &gt; &gt; <a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;, "Nithya Balachandran"<br>
&gt; &gt; &gt; &gt; &gt; &gt; &lt;<a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Cc: "Gluster Devel" &lt;<a href="mailto:gluster-devel@gluster.org" target="_blank">gluster-devel@gluster.org</a>&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Sent: Friday, September 30, 2016 8:39:28 AM<br>
&gt; &gt; &gt; &gt; &gt; &gt; Subject: Dht readdir filtering out names<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; hi,<br>
&gt; &gt; &gt; &gt; &gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; In dht_readdirp_cbk() there is a check about skipping files<br>
&gt; &gt; &gt; &gt; &gt; without<br>
&gt; &gt; &gt; &gt; &gt; &gt; ia_type. Could you help me understand why this check is added?<br>
&gt; &gt; &gt; &gt; &gt; &gt; There<br>
&gt; &gt; &gt; are<br>
&gt; &gt; &gt; &gt; &gt; &gt; times when users have to delete gfid of the entries and trigger<br>
&gt; &gt; &gt; something<br>
&gt; &gt; &gt; &gt; &gt; &gt; like 'find . | xargs stat' to heal the gfids. This case would fail<br>
&gt; &gt; &gt; if we<br>
&gt; &gt; &gt; &gt; &gt; &gt; skip entries without gfid, if the lower xlators don't send stat<br>
&gt; &gt; &gt; &gt; &gt; information<br>
&gt; &gt; &gt; &gt; &gt; &gt; for them.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Probably we can make readdirp_cbk not rely on ia_type and pass _all_<br>
&gt; &gt; &gt; &gt; &gt; dentries received by subvols to application without filtering.<br>
&gt; &gt; &gt; &gt; &gt; However<br>
&gt; &gt; &gt; we<br>
&gt; &gt; &gt; &gt; &gt; should make this behaviour optional and use this only for recovery<br>
&gt; &gt; &gt; setups.<br>
&gt; &gt; &gt; &gt; &gt; If we don't rely on ia_type (during non error scenarios),<br>
&gt; &gt; &gt; &gt; &gt; applications<br>
&gt; &gt; &gt; end<br>
&gt; &gt; &gt; &gt; &gt; up seeing duplicate dentries in readdir listing.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; That means dht_readdir() gives duplicate entries? As per the code it<br>
&gt; &gt; &gt; seems<br>
&gt; &gt; &gt; &gt; like it...<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; No. It follows the filtering logic of "pick dentry only from hashed<br>
&gt; &gt; &gt; subvol". This logic doesn't need ia_type. Now, that you brought the topic<br>
&gt; &gt; &gt; of dht_readdir, I've another solution for your use case (Basically don't<br>
&gt; &gt; &gt; use readdirp :) ):<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; 1. mount glusterfs with "--use-readdirp=no" option.<br>
&gt; &gt; &gt; 2. disable md-cache/stat-prefetch as it converts all readdir calls into<br>
&gt; &gt; &gt; readdirp calls<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Probably the ones in dht as well? i.e. use-readdirp option.<br>
&gt;<br>
&gt; No. dht doesn't convert a readdir into readdirp. The option you are referring<br>
&gt; to might be "readdir-optimize" which is something different.<br>
<br>
</div></div>Sorry. I was wrong. There is an option in dht too, to force using readdirp. As you said, we should disable that too.<br>
<div><div><br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Use this only for recovery setups :).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt; Pranith<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; regards,<br>
&gt; &gt; &gt; &gt; &gt; Raghavendra<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; Pranith<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Pranith<br>
&gt; &gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><span data-mce-style="color: #888888;" style="color: #888888;">-- <br><div><div dir="ltr">Pranith<br></div></div>
</span></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Pranith<br></div></div>
</div>
</blockquote><div><br></div></div></body></html>