<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/dcache.c, branch linux-3.14.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>fix d_walk()/non-delayed __d_free() race</title>
<updated>2016-09-11T07:59:58+00:00</updated>
<author>
<name>Willy Tarreau</name>
<email>w@1wt.eu</email>
</author>
<published>2016-08-27T09:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7cac57a69919afdf3bdda5242afdd535b2d9a2b0'/>
<id>7cac57a69919afdf3bdda5242afdd535b2d9a2b0</id>
<content type='text'>
I checked Jari's explanation below and found that v3.14.77 and v3.12.62
are missing the same fix as 3.10. In fact Al's original commit 3d56c25
("fix d_walk()/non-delayed __d_free() race") used to mention to check 
this __d_materialise_dentry() function in the Cc: stable line, but this
got lost during the backports.

Normally all of our 3 kernels need to apply the following patch that
Ben correctly put in 3.16 and 3.2. I'm fixing the backport in 3.10.103
right now.

On Mon, Aug 22, 2016 at 04:56:57PM +0300, Jari Ruusu wrote:
&gt; This patch for 3.10 branch appears to be missing one important
&gt; 
&gt; +       dentry-&gt;d_flags |= DCACHE_RCUACCESS;
&gt; 
&gt; in fs/dcache.c __d_materialise_dentry() function. When Ben Hutchings
&gt; backported Al Viro's original fix to stable branches that he maintains,
&gt; he added that one additional line to both 3.2 and 3.16 branches. Please
&gt; consider including that additional one line fix for 3.10 stable branch
&gt; also.
&gt; 
&gt; 
&gt; Ben Hutchings said this on his 3.2.82-rc1 patch:
&gt; [bwh: Backported to 3.2:
&gt;  - Adjust context
&gt;  - Also set the flag in __d_materialise_dentry())]
&gt; 
&gt; http://marc.info/?l=linux-kernel&amp;m=147117565612275&amp;w=2
&gt; 
&gt; 
&gt; Ben Hutchings said this on his 3.16.37-rc1 patch:
&gt; [bwh: Backported to 3.16:
&gt;  - Adjust context
&gt;  - Also set the flag in __d_materialise_dentry())]
&gt; 
&gt; http://marc.info/?l=linux-kernel&amp;m=147117433412006&amp;w=2
&gt; 
&gt; 
&gt; Also mentioned by Sasha Levin on 3.18 and 4.1 commits:
&gt; Cc: stable@vger.kernel.org # v3.2+ (and watch out for __d_materialise_dentry())
&gt; 
&gt; http://marc.info/?l=linux-stable-commits&amp;m=146648034410827&amp;w=2
&gt; http://marc.info/?l=linux-stable-commits&amp;m=146647471009771&amp;w=2


Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I checked Jari's explanation below and found that v3.14.77 and v3.12.62
are missing the same fix as 3.10. In fact Al's original commit 3d56c25
("fix d_walk()/non-delayed __d_free() race") used to mention to check 
this __d_materialise_dentry() function in the Cc: stable line, but this
got lost during the backports.

Normally all of our 3 kernels need to apply the following patch that
Ben correctly put in 3.16 and 3.2. I'm fixing the backport in 3.10.103
right now.

On Mon, Aug 22, 2016 at 04:56:57PM +0300, Jari Ruusu wrote:
&gt; This patch for 3.10 branch appears to be missing one important
&gt; 
&gt; +       dentry-&gt;d_flags |= DCACHE_RCUACCESS;
&gt; 
&gt; in fs/dcache.c __d_materialise_dentry() function. When Ben Hutchings
&gt; backported Al Viro's original fix to stable branches that he maintains,
&gt; he added that one additional line to both 3.2 and 3.16 branches. Please
&gt; consider including that additional one line fix for 3.10 stable branch
&gt; also.
&gt; 
&gt; 
&gt; Ben Hutchings said this on his 3.2.82-rc1 patch:
&gt; [bwh: Backported to 3.2:
&gt;  - Adjust context
&gt;  - Also set the flag in __d_materialise_dentry())]
&gt; 
&gt; http://marc.info/?l=linux-kernel&amp;m=147117565612275&amp;w=2
&gt; 
&gt; 
&gt; Ben Hutchings said this on his 3.16.37-rc1 patch:
&gt; [bwh: Backported to 3.16:
&gt;  - Adjust context
&gt;  - Also set the flag in __d_materialise_dentry())]
&gt; 
&gt; http://marc.info/?l=linux-kernel&amp;m=147117433412006&amp;w=2
&gt; 
&gt; 
&gt; Also mentioned by Sasha Levin on 3.18 and 4.1 commits:
&gt; Cc: stable@vger.kernel.org # v3.2+ (and watch out for __d_materialise_dentry())
&gt; 
&gt; http://marc.info/?l=linux-stable-commits&amp;m=146648034410827&amp;w=2
&gt; http://marc.info/?l=linux-stable-commits&amp;m=146647471009771&amp;w=2


Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fix d_walk()/non-delayed __d_free() race</title>
<updated>2016-06-24T17:15:29+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2016-06-08T01:26:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9db6c45bb3858dffba95afec2ccb8d05805cdff1'/>
<id>9db6c45bb3858dffba95afec2ccb8d05805cdff1</id>
<content type='text'>
commit 3d56c25e3bb0726a5c5e16fc2d9e38f8ed763085 upstream.

Ascend-to-parent logics in d_walk() depends on all encountered child
dentries not getting freed without an RCU delay.  Unfortunately, in
quite a few cases it is not true, with hard-to-hit oopsable race as
the result.

Fortunately, the fix is simiple; right now the rule is "if it ever
been hashed, freeing must be delayed" and changing it to "if it
ever had a parent, freeing must be delayed" closes that hole and
covers all cases the old rule used to cover.  Moreover, pipes and
sockets remain _not_ covered, so we do not introduce RCU delay in
the cases which are the reason for having that delay conditional
in the first place.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3d56c25e3bb0726a5c5e16fc2d9e38f8ed763085 upstream.

Ascend-to-parent logics in d_walk() depends on all encountered child
dentries not getting freed without an RCU delay.  Unfortunately, in
quite a few cases it is not true, with hard-to-hit oopsable race as
the result.

Fortunately, the fix is simiple; right now the rule is "if it ever
been hashed, freeing must be delayed" and changing it to "if it
ever had a parent, freeing must be delayed" closes that hole and
covers all cases the old rule used to cover.  Moreover, pipes and
sockets remain _not_ covered, so we do not introduce RCU delay in
the cases which are the reason for having that delay conditional
in the first place.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lock_parent: don't step on stale -&gt;d_parent of all-but-freed one</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-06-12T04:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4d57edcd044c0a5e0ae5241ec51962f5219caee2'/>
<id>4d57edcd044c0a5e0ae5241ec51962f5219caee2</id>
<content type='text'>
commit c2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 upstream.

Dentry that had been through (or into) __dentry_kill() might be seen
by shrink_dentry_list(); that's normal, it'll be taken off the shrink
list and freed if __dentry_kill() has already finished.  The problem
is, its -&gt;d_parent might be pointing to already freed dentry, so
lock_parent() needs to be careful.

We need to check that dentry hasn't already gone into __dentry_kill()
*and* grab rcu_read_lock() before dropping -&gt;d_lock - the latter makes
sure that whatever we see in -&gt;d_parent after dropping -&gt;d_lock it
won't be freed until we drop rcu_read_lock().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 upstream.

Dentry that had been through (or into) __dentry_kill() might be seen
by shrink_dentry_list(); that's normal, it'll be taken off the shrink
list and freed if __dentry_kill() has already finished.  The problem
is, its -&gt;d_parent might be pointing to already freed dentry, so
lock_parent() needs to be careful.

We need to check that dentry hasn't already gone into __dentry_kill()
*and* grab rcu_read_lock() before dropping -&gt;d_lock - the latter makes
sure that whatever we see in -&gt;d_parent after dropping -&gt;d_lock it
won't be freed until we drop rcu_read_lock().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>dcache: add missing lockdep annotation</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-05-31T16:13:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=001869c34bdefa35f021f2633ed37122cfd3aa2d'/>
<id>001869c34bdefa35f021f2633ed37122cfd3aa2d</id>
<content type='text'>
commit 9f12600fe425bc28f0ccba034a77783c09c15af4 upstream.

lock_parent() very much on purpose does nested locking of dentries, and
is careful to maintain the right order (lock parent first).  But because
it didn't annotate the nested locking order, lockdep thought it might be
a deadlock on d_lock, and complained.

Add the proper annotation for the inner locking of the child dentry to
make lockdep happy.

Introduced by commit 046b961b45f9 ("shrink_dentry_list(): take parent's
-&gt;d_lock earlier").

Reported-and-tested-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9f12600fe425bc28f0ccba034a77783c09c15af4 upstream.

lock_parent() very much on purpose does nested locking of dentries, and
is careful to maintain the right order (lock parent first).  But because
it didn't annotate the nested locking order, lockdep thought it might be
a deadlock on d_lock, and complained.

Add the proper annotation for the inner locking of the child dentry to
make lockdep happy.

Introduced by commit 046b961b45f9 ("shrink_dentry_list(): take parent's
-&gt;d_lock earlier").

Reported-and-tested-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>dentry_kill() doesn't need the second argument now</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-29T13:18:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b004c3a7f5ee27001a39892874c733d23b7ecbc6'/>
<id>b004c3a7f5ee27001a39892874c733d23b7ecbc6</id>
<content type='text'>
commit 8cbf74da435d1bd13dbb790f94c7ff67b2fb6af4 upstream.

it's 1 in the only remaining caller.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8cbf74da435d1bd13dbb790f94c7ff67b2fb6af4 upstream.

it's 1 in the only remaining caller.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>dealing with the rest of shrink_dentry_list() livelock</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-29T13:11:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6179fe3753519bb624d767c02f9b685642cc63df'/>
<id>6179fe3753519bb624d767c02f9b685642cc63df</id>
<content type='text'>
commit b2b80195d8829921506880f6dccd21cabd163d0d upstream.

We have the same problem with -&gt;d_lock order in the inner loop, where
we are dropping references to ancestors.  Same solution, basically -
instead of using dentry_kill() we use lock_parent() (introduced in the
previous commit) to get that lock in a safe way, recheck -&gt;d_count
(in case if lock_parent() has ended up dropping and retaking -&gt;d_lock
and somebody managed to grab a reference during that window), trylock
the inode-&gt;i_lock and use __dentry_kill() to do the rest.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b2b80195d8829921506880f6dccd21cabd163d0d upstream.

We have the same problem with -&gt;d_lock order in the inner loop, where
we are dropping references to ancestors.  Same solution, basically -
instead of using dentry_kill() we use lock_parent() (introduced in the
previous commit) to get that lock in a safe way, recheck -&gt;d_count
(in case if lock_parent() has ended up dropping and retaking -&gt;d_lock
and somebody managed to grab a reference during that window), trylock
the inode-&gt;i_lock and use __dentry_kill() to do the rest.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>shrink_dentry_list(): take parent's -&gt;d_lock earlier</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-29T12:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=286adf77d94e8b57a620e6cdbdcc72d99d8609b3'/>
<id>286adf77d94e8b57a620e6cdbdcc72d99d8609b3</id>
<content type='text'>
commit 046b961b45f93a92e4c70525a12f3d378bced130 upstream.

The cause of livelocks there is that we are taking -&gt;d_lock on
dentry and its parent in the wrong order, forcing us to use
trylock on the parent's one.  d_walk() takes them in the right
order, and unfortunately it's not hard to create a situation
when shrink_dentry_list() can't make progress since trylock
keeps failing, and shrink_dcache_parent() or check_submounts_and_drop()
keeps calling d_walk() disrupting the very shrink_dentry_list() it's
waiting for.

Solution is straightforward - if that trylock fails, let's unlock
the dentry itself and take locks in the right order.  We need to
stabilize -&gt;d_parent without holding -&gt;d_lock, but that's doable
using RCU.  And we'd better do that in the very beginning of the
loop in shrink_dentry_list(), since the checks on refcount, etc.
would need to be redone anyway.

That deals with a half of the problem - killing dentries on the
shrink list itself.  Another one (dropping their parents) is
in the next commit.

locking parent is interesting - it would be easy to do rcu_read_lock(),
lock whatever we think is a parent, lock dentry itself and check
if the parent is still the right one.  Except that we need to check
that *before* locking the dentry, or we are risking taking -&gt;d_lock
out of order.  Fortunately, once the D1 is locked, we can check if
D2-&gt;d_parent is equal to D1 without the need to lock D2; D2-&gt;d_parent
can start or stop pointing to D1 only under D1-&gt;d_lock, so taking
D1-&gt;d_lock is enough.  In other words, the right solution is
rcu_read_lock/lock what looks like parent right now/check if it's
still our parent/rcu_read_unlock/lock the child.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 046b961b45f93a92e4c70525a12f3d378bced130 upstream.

The cause of livelocks there is that we are taking -&gt;d_lock on
dentry and its parent in the wrong order, forcing us to use
trylock on the parent's one.  d_walk() takes them in the right
order, and unfortunately it's not hard to create a situation
when shrink_dentry_list() can't make progress since trylock
keeps failing, and shrink_dcache_parent() or check_submounts_and_drop()
keeps calling d_walk() disrupting the very shrink_dentry_list() it's
waiting for.

Solution is straightforward - if that trylock fails, let's unlock
the dentry itself and take locks in the right order.  We need to
stabilize -&gt;d_parent without holding -&gt;d_lock, but that's doable
using RCU.  And we'd better do that in the very beginning of the
loop in shrink_dentry_list(), since the checks on refcount, etc.
would need to be redone anyway.

That deals with a half of the problem - killing dentries on the
shrink list itself.  Another one (dropping their parents) is
in the next commit.

locking parent is interesting - it would be easy to do rcu_read_lock(),
lock whatever we think is a parent, lock dentry itself and check
if the parent is still the right one.  Except that we need to check
that *before* locking the dentry, or we are risking taking -&gt;d_lock
out of order.  Fortunately, once the D1 is locked, we can check if
D2-&gt;d_parent is equal to D1 without the need to lock D2; D2-&gt;d_parent
can start or stop pointing to D1 only under D1-&gt;d_lock, so taking
D1-&gt;d_lock is enough.  In other words, the right solution is
rcu_read_lock/lock what looks like parent right now/check if it's
still our parent/rcu_read_unlock/lock the child.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>expand dentry_kill(dentry, 0) in shrink_dentry_list()</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-28T17:59:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d2cac5b667889e625290f6fc758133baded7aa7b'/>
<id>d2cac5b667889e625290f6fc758133baded7aa7b</id>
<content type='text'>
commit ff2fde9929feb2aef45377ce56b8b12df85dda69 upstream.

Result will be massaged to saner shape in the next commits.  It is
ugly, no questions - the point of that one is to be a provably
equivalent transformation (and it might be worth splitting a bit
more).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ff2fde9929feb2aef45377ce56b8b12df85dda69 upstream.

Result will be massaged to saner shape in the next commits.  It is
ugly, no questions - the point of that one is to be a provably
equivalent transformation (and it might be worth splitting a bit
more).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>split dentry_kill()</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-28T17:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c233eac2740e5234480ac2a33f753f46fa81512a'/>
<id>c233eac2740e5234480ac2a33f753f46fa81512a</id>
<content type='text'>
commit e55fd011549eae01a230e3cace6f4d031b6a3453 upstream.

... into trylocks and everything else.  The latter (actual killing)
is __dentry_kill().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e55fd011549eae01a230e3cace6f4d031b6a3453 upstream.

... into trylocks and everything else.  The latter (actual killing)
is __dentry_kill().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lift the "already marked killed" case into shrink_dentry_list()</title>
<updated>2016-03-03T23:06:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-05-28T13:48:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f718ea386c2f2a077e29a0f338507cfcd75e55cd'/>
<id>f718ea386c2f2a077e29a0f338507cfcd75e55cd</id>
<content type='text'>
commit 64fd72e0a44bdd62c5ca277cb24d0d02b2d8e9dc upstream.

It can happen only when dentry_kill() is called with unlock_on_failure
equal to 0 - other callers had dentry pinned until the moment they've
got -&gt;d_lock and DCACHE_DENTRY_KILLED is set only after lockref_mark_dead().

IOW, only one of three call sites of dentry_kill() might end up reaching
that code.  Just move it there.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 64fd72e0a44bdd62c5ca277cb24d0d02b2d8e9dc upstream.

It can happen only when dentry_kill() is called with unlock_on_failure
equal to 0 - other callers had dentry pinned until the moment they've
got -&gt;d_lock and DCACHE_DENTRY_KILLED is set only after lockref_mark_dead().

IOW, only one of three call sites of dentry_kill() might end up reaching
that code.  Just move it there.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
