<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 2:52 PM, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Raghavendra Gowdappa&quot; &lt;<a href="mailto:rgowdapp@redhat.com">rgowdapp@redhat.com</a>&gt;<br>
&gt; To: &quot;Nithya Balachandran&quot; &lt;<a href="mailto:nbalacha@redhat.com">nbalacha@redhat.com</a>&gt;<br>
&gt; Cc: <a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a><br>
</span><div><div class="h5">&gt; Sent: Tuesday, May 17, 2016 2:40:32 PM<br>
&gt; Subject: Re: [Gluster-devel] &#39;mv&#39; of ./tests/bugs/posix/bug-1113960.t causes 100% CPU<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt; &gt; From: &quot;Nithya Balachandran&quot; &lt;<a href="mailto:nbalacha@redhat.com">nbalacha@redhat.com</a>&gt;<br>
&gt; &gt; To: &quot;Niels de Vos&quot; &lt;<a href="mailto:ndevos@redhat.com">ndevos@redhat.com</a>&gt;<br>
&gt; &gt; Cc: <a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a><br>
&gt; &gt; Sent: Tuesday, May 17, 2016 2:25:20 PM<br>
&gt; &gt; Subject: Re: [Gluster-devel] &#39;mv&#39; of ./tests/bugs/posix/bug-1113960.t<br>
&gt; &gt; causes 100% CPU<br>
&gt; &gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I have looked into this on another system earlier and this is what I have<br>
&gt; &gt; so<br>
&gt; &gt; far:<br>
&gt; &gt;<br>
&gt; &gt; 1. The test involves moving and renaming directories and files within those<br>
&gt; &gt; dirs.<br>
&gt; &gt; 2. A rename dir operation failed on one subvol. So we have 3 subvols where<br>
&gt; &gt; the directory has the new name and one where it has the old name.<br>
&gt; &gt; 3. Some operation - perhaps a revalidate - has added a dentry with the old<br>
&gt; &gt; name to the inode . So there are now 2 dentries for the same inode for a<br>
&gt; &gt; directory.<br>
&gt;<br>
&gt; I think the stale dentry is caused by a racing lookup and rename.<br>
<br>
</div></div>Please refer to bz 1335373 [1] for more details.<br>
<br>
[1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1335373" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1335373</a></blockquote><div><br></div><div><br></div><div>I have posted a &quot;hacky&quot; patch at [2]</div><div><br></div><div>[2] <a href="http://review.gluster.org/#/c/14373/">http://review.gluster.org/#/c/14373/</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
<div class=""><div class="h5"><br>
&gt; Apart from<br>
&gt; that, I don&#39;t know of any other reasons for stale dentries in inode table.<br>
&gt; &quot;Dentry fop serializer&quot; (DFS) [1], aims to solve these kind of races.<br>
&gt;<br>
&gt; [1] <a href="http://review.gluster.org/14286" rel="noreferrer" target="_blank">http://review.gluster.org/14286</a><br>
&gt;<br>
&gt; &gt; 4. Renaming a file inside that directory calls an inode_link which end up<br>
&gt; &gt; traversing the dentry list for each entry all the way up to the root in the<br>
&gt; &gt; __foreach_ancestor_dentry function. If there are multiple deep directories<br>
&gt; &gt; with the same problem in the path, this takes a very long time (hours)<br>
&gt; &gt; because of the number of times the function is called.<br>
&gt; &gt;<br>
&gt; &gt; I do not know why the rename dir failed. However, is the following a<br>
&gt; &gt; correct/acceptable fix for the traversal issue?<br>
&gt; &gt;<br>
&gt; &gt; 1. A directory should never have more than one dentry<br>
&gt; &gt; 2. __foreach_ancestor_dentry uses the dentry list of the parent inode.<br>
&gt; &gt; Parent<br>
&gt; &gt; inode will always be a directory.<br>
&gt; &gt; 3. Can we just take the first dentry in the list for the cycle check as we<br>
&gt; &gt; are really only comparing inodes? In the scenarios I have tried, all the<br>
&gt; &gt; dentries in the dentry_list always have the same inode. This would prevent<br>
&gt; &gt; the hang. If there is more than one dentry for a directory, flag an error<br>
&gt; &gt; somehow.<br>
&gt; &gt; 4. Is there any chance that a dentry in the list can have a different<br>
&gt; &gt; inode?<br>
&gt; &gt; If yes, that is a different problem and 3 does not apply.<br>
&gt; &gt;<br>
&gt; &gt; It would work like this:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; last_parent_inode = NULL;<br>
&gt; &gt;<br>
&gt; &gt; list_for_each_entry (each, &amp;parent-&gt;dentry_list, inode_list) {<br>
&gt; &gt;<br>
&gt; &gt; //Since we are only using the each-&gt;parent to check, stop if we have<br>
&gt; &gt; already<br>
&gt; &gt; checked it<br>
&gt; &gt;<br>
&gt; &gt; if(each-&gt;parent != last_parent_inode) {<br>
&gt; &gt; ret = __foreach_ancestor_dentry (each, per_dentry_fn, data);<br>
&gt; &gt; if (ret)<br>
&gt; &gt; goto out;<br>
&gt; &gt; }<br>
&gt; &gt; last_parent_inode = each-&gt;parent;<br>
&gt; &gt; }<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; This would prevent the hang but leads to other issues which would exist in<br>
&gt; &gt; the current code anyway - mainly, which dentry is the correct one and how<br>
&gt; &gt; do<br>
&gt; &gt; we recover?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Nithya<br>
&gt; &gt;<br>
&gt; &gt; On Wed, May 11, 2016 at 7:09 PM, Niels de Vos &lt; <a href="mailto:ndevos@redhat.com">ndevos@redhat.com</a> &gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Could someone look into this busy loop?<br>
&gt; &gt; <a href="https://paste.fedoraproject.org/365207/29732171/raw/" rel="noreferrer" target="_blank">https://paste.fedoraproject.org/365207/29732171/raw/</a><br>
&gt; &gt;<br>
&gt; &gt; This was happening in a regression-test burn-in run, occupying a Jenkins<br>
&gt; &gt; slave for 2+ days:<br>
&gt; &gt; <a href="https://build.gluster.org/job/regression-test-burn-in/936/" rel="noreferrer" target="_blank">https://build.gluster.org/job/regression-test-burn-in/936/</a><br>
&gt; &gt; (run with commit f0ade919006b2581ae192f997a8ae5bacc2892af from master)<br>
&gt; &gt;<br>
&gt; &gt; A coredump of the mount process is available from here:<br>
&gt; &gt; <a href="http://slave20.cloud.gluster.org/archived_builds/crash.tar.gz" rel="noreferrer" target="_blank">http://slave20.cloud.gluster.org/archived_builds/crash.tar.gz</a><br>
&gt; &gt;<br>
&gt; &gt; Thanks misc for reporting and gathering the debugging info.<br>
&gt; &gt; Niels<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Gluster-devel mailing list<br>
&gt; &gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; &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; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Gluster-devel mailing list<br>
&gt; &gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; &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; Gluster-devel mailing list<br>
&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><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>
</div></div></blockquote></div><br></div></div>