<div dir="ltr"><div><br></div><div>I can understand the concern. But I think instead of generally converting all the ESTALE errors ENOENT, probably we should try to analyze the errors that are generated by lower layers (like posix).</div><div><br></div><div>Even fuse kernel module some times returns ESTALE. (Well, I can see it returning ESTALE errors in some cases in the code. Someone please correct me if thats not the case).  And aso I am not sure if converting all the ESTALE errors to ENOENT is ok or not.</div><div><br></div><div>For fd based operations, I am not sure if ENOENT can be sent or not (as though the file is unlinked, it can be accessed if there were open fds on it before unlinking the file).</div><div><br></div><div>I feel, we have to look into some parts to check if they generating ESTALE is a proper error or not. Also, if there is any bug in below layers fixing which can avoid ESTALE errors, then I feel that would be the better option.</div><div><br></div><div>My 2 cents.</div><div><br></div><div>Regards,</div><div>Raghavendra</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 1:39 AM, Prashanth Pai <span dir="ltr">&lt;<a href="mailto:ppai@redhat.com" target="_blank">ppai@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">TL;DR: +1 to report ESTALE as ENOENT<br>
<br>
While ESTALE is an acceptable errno for NFS clients, it&#39;s not so much for<br>
FUSE clients. Many applications that talk to a FUSE mount do not handle<br>
ESTALE and expect the behavior to be analogous to that of local<br>
filesystems such as XFS. While it&#39;s okay for brick to send ESTALE to<br>
glusterfs client stack, one has to be very careful about errno returned by<br>
FUSE back to applications.<br>
<br>
For example, syscalls such as fgetxattr are not expected (at least from<br>
manpage) to throw ESTALE but with glusterfs, it does[1]. Further, POSIX<br>
guarantees that once an application has a valid fd, operations like<br>
fgetxattr() on the fd should succeed even after another application(client)<br>
issues an unlink()<br>
<br>
[1]:<a href="http://paste.openstack.org/show/335506/" rel="noreferrer" target="_blank">http://paste.openstack.org/show/335506/</a><br>
<br>
Regards,<br>
 -Prashanth Pai<br>
<div><div class="h5"><br>
----- Original Message -----<br>
&gt; From: &quot;FNU Raghavendra Manjunath&quot; &lt;<a href="mailto:rabhat@redhat.com">rabhat@redhat.com</a>&gt;<br>
&gt; To: &quot;Soumya Koduri&quot; &lt;<a href="mailto:skoduri@redhat.com">skoduri@redhat.com</a>&gt;<br>
&gt; Cc: &quot;Ira Cooper&quot; &lt;<a href="mailto:icooper@redhat.com">icooper@redhat.com</a>&gt;, &quot;Gluster Devel&quot; &lt;<a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a>&gt;<br>
&gt; Sent: Thursday, March 24, 2016 8:11:19 PM<br>
&gt; Subject: Re: [Gluster-devel] Report ESTALE as ENOENT<br>
&gt;<br>
&gt;<br>
&gt; I would still prefer not converting all the ESTALE to ENOENT. I think we need<br>
&gt; to understand this specific case of parallel rm -rfs getting ESTALE errors<br>
&gt; and handle it accordingly.<br>
&gt;<br>
&gt; Regarding, gfapi not honoring the ESTALE errors, I think it would be better<br>
&gt; to do revalidates upon getting ESTALE.<br>
&gt;<br>
&gt; Just my 2 cents.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Raghavendra<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Mar 24, 2016 at 10:31 AM, Soumya Koduri &lt; <a href="mailto:skoduri@redhat.com">skoduri@redhat.com</a> &gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; Thanks for the information.<br>
&gt;<br>
&gt; On 03/24/2016 07:34 PM, FNU Raghavendra Manjunath wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Yes. I think the caching example mentioned by Shyam is a good example of<br>
&gt; ESTALE error. Also User Serviceable Snapshots (USS) relies heavily on<br>
&gt; ESTALE errors. Because the files/directories from the snapshots are<br>
&gt; assigned a virtual gfid on the fly when being looked up. If those inodes<br>
&gt; are purged out of the inode table due to lru list becoming full, then a<br>
&gt; access to that gfid from the client, will make snapview-server send<br>
&gt; ESTALE and either fuse (I think our fuse xlator does a revalidate upon<br>
&gt; getting ESTALE) or NFS client can revalidate via path based resolution.<br>
&gt;<br>
&gt; So wouldn&#39;t it be wrong not to send ESTALE to NFS-clients and map it to<br>
&gt; ENOENT, as was intended in the original mail.<br>
&gt;<br>
&gt; NFSv3 rfc [1] mentions that NFS3ERR_STALE is a valid error for REMOVE fop.<br>
&gt;<br>
&gt; Also (at least in gfapi) the resolve code path doesn&#39;t seem to be honoring<br>
&gt; ESTALE errors - glfs_resolve_component(..), glfs_refresh_inode_safe(..)<br>
&gt; etc.. Do we need to fix them?<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Soumya<br>
&gt;<br>
&gt; [1] <a href="https://www.ietf.org/rfc/rfc1813.txt" rel="noreferrer" target="_blank">https://www.ietf.org/rfc/rfc1813.txt</a> (section# 3.3.12)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt; Raghavendra<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Mar 24, 2016 at 9:51 AM, Shyam &lt; <a href="mailto:srangana@redhat.com">srangana@redhat.com</a><br>
&gt; &lt;mailto: <a href="mailto:srangana@redhat.com">srangana@redhat.com</a> &gt;&gt; wrote:<br>
&gt;<br>
&gt; On 03/23/2016 12:07 PM, Ravishankar N wrote:<br>
&gt;<br>
&gt; On 03/23/2016 09:16 PM, Soumya Koduri wrote:<br>
&gt;<br>
&gt; If it occurs only when the file/dir is not actually present<br>
&gt; at the<br>
&gt; back-end, shouldn&#39;t we fix the server to send ENOENT then?<br>
&gt;<br>
&gt; I never fully understood it here is the answer:<br>
&gt; <a href="http://review.gluster.org/#/c/6318/" rel="noreferrer" target="_blank">http://review.gluster.org/#/c/6318/</a><br>
&gt;<br>
&gt;<br>
&gt; The intention of ESTALE is to state that the inode#/GFID is stale,<br>
&gt; when using that for any operations. IOW, we did not find the GFID in<br>
&gt; the backend, that does not mean the name is not present. This hence<br>
&gt; means, if you have a pGFID+bname, try resolving with that.<br>
&gt;<br>
&gt; For example, a client side cache can hang onto a GFID for a bname,<br>
&gt; but another client could have, in the interim, unlinked the bname<br>
&gt; and create a new file there.<br>
&gt;<br>
&gt; A presence test using GFID by the client that cached the result the<br>
&gt; first time, is an ESTALE. But a resolution based on pGFID+bname<br>
&gt; again by the same client would be a success.<br>
&gt;<br>
&gt; By extension, a GFID based resolution, when not really present in<br>
&gt; the backend will return ESTALE, it could very well mean ENOENT, but<br>
&gt; that has to be determined by the client again, if possible.<br>
&gt;<br>
&gt; See &quot;A10. What does it mean when my application fails because of an<br>
&gt; ESTALE error?&quot; for NFS here [1] and [2] (there maybe better sources<br>
&gt; for this information)<br>
&gt;<br>
&gt; [1] <a href="http://nfs.sourceforge.net/" rel="noreferrer" target="_blank">http://nfs.sourceforge.net/</a><br>
&gt; [2] <a href="https://lwn.net/Articles/272684/" rel="noreferrer" target="_blank">https://lwn.net/Articles/272684/</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gluster-devel mailing list<br>
&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a> &lt;mailto: <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a> &gt;<br>
&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gluster-devel mailing list<br>
&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a> &lt;mailto: <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a> &gt;<br>
&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gluster-devel mailing list<br>
&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
</div></div>&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br></div>