stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Patch 3.14 stable 01/16] fold d_kill() and d_free()
       [not found] ` <1415302640-5876-2-git-send-email-xiyou.wangcong@gmail.com>
@ 2015-05-18 17:44   ` Greg KH
  2015-05-21  0:31     ` [PATCH 3.14] " Vinson Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2015-05-18 17:44 UTC (permalink / raw)
  To: Cong Wang; +Cc: stable, viro, linux-fsdevel

On Thu, Nov 06, 2014 at 11:37:05AM -0800, Cong Wang wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> (cherry picked from commit 03b3b889e79cdb6b806fc0ba9be0d71c186bbfaa)
> ---
>  fs/dcache.c | 76 +++++++++++++++++++------------------------------------------
>  1 file changed, 24 insertions(+), 52 deletions(-)

This patch doesn't apply to the 3.14-stable tree anymore.

I know it's been a while, but could you respin this series and resend
them if you think it's still needed for 3.14-stable?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3.14] fold d_kill() and d_free()
  2015-05-18 17:44   ` [Patch 3.14 stable 01/16] fold d_kill() and d_free() Greg KH
@ 2015-05-21  0:31     ` Vinson Lee
  2015-05-21  0:31       ` [PATCH] " Vinson Lee
  2015-06-29 23:56       ` [PATCH 3.14] " Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Vinson Lee @ 2015-05-21  0:31 UTC (permalink / raw)
  To: Greg KH, Cong Wang, viro; +Cc: stable, linux-fsdevel, Vinson Lee

From: Vinson Lee <vlee@twitter.com>

This is a backport of 03b3b889e79cdb6b806fc0ba9be0d71c186bbfaa "fold 
d_kill() and d_free()" to stable kernel 3.14.

The other 15 patches (patches 2-16) from the "vfs: fix dentry shrink 
list corruption" stable request still apply on top of 3.14.43.

Al Viro (1):
  fold d_kill() and d_free()

 fs/dcache.c | 77 +++++++++++++++++++------------------------------------------
 1 file changed, 24 insertions(+), 53 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] fold d_kill() and d_free()
  2015-05-21  0:31     ` [PATCH 3.14] " Vinson Lee
@ 2015-05-21  0:31       ` Vinson Lee
  2015-06-29 23:56       ` [PATCH 3.14] " Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Vinson Lee @ 2015-05-21  0:31 UTC (permalink / raw)
  To: Greg KH, Cong Wang, viro; +Cc: stable, linux-fsdevel, Vinson Lee

From: Al Viro <viro@zeniv.linux.org.uk>

commit 03b3b889e79cdb6b806fc0ba9be0d71c186bbfaa upstream.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ vlee: Backported to 3.14. Adjusted context. ]
Signed-off-by: Vinson Lee <vlee@twitter.com>
---
 fs/dcache.c | 77 +++++++++++++++++++------------------------------------------
 1 file changed, 24 insertions(+), 53 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index a9231c8..8486607 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -244,24 +244,6 @@ static void __d_free(struct rcu_head *head)
 	kmem_cache_free(dentry_cache, dentry); 
 }
 
-/*
- * no locks, please.
- */
-static void d_free(struct dentry *dentry)
-{
-	WARN_ON(!hlist_unhashed(&dentry->d_u.d_alias));
-	BUG_ON((int)dentry->d_lockref.count > 0);
-	this_cpu_dec(nr_dentry);
-	if (dentry->d_op && dentry->d_op->d_release)
-		dentry->d_op->d_release(dentry);
-
-	/* if dentry was never visible to RCU, immediate free is OK */
-	if (!(dentry->d_flags & DCACHE_RCUACCESS))
-		__d_free(&dentry->d_u.d_rcu);
-	else
-		call_rcu(&dentry->d_u.d_rcu, __d_free);
-}
-
 /**
  * dentry_rcuwalk_barrier - invalidate in-progress rcu-walk lookups
  * @dentry: the target dentry
@@ -419,40 +401,6 @@ static void dentry_lru_del(struct dentry *dentry)
 }
 
 /**
- * d_kill - kill dentry and return parent
- * @dentry: dentry to kill
- * @parent: parent dentry
- *
- * The dentry must already be unhashed and removed from the LRU.
- *
- * If this is the root of the dentry tree, return NULL.
- *
- * dentry->d_lock and parent->d_lock must be held by caller, and are dropped by
- * d_kill.
- */
-static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent)
-	__releases(dentry->d_lock)
-	__releases(parent->d_lock)
-	__releases(dentry->d_inode->i_lock)
-{
-	__list_del_entry(&dentry->d_child);
-	/*
-	 * Inform d_walk() that we are no longer attached to the
-	 * dentry tree
-	 */
-	dentry->d_flags |= DCACHE_DENTRY_KILLED;
-	if (parent)
-		spin_unlock(&parent->d_lock);
-	dentry_iput(dentry);
-	/*
-	 * dentry_iput drops the locks, at which point nobody (except
-	 * transient RCU lookups) can reach this dentry.
-	 */
-	d_free(dentry);
-	return parent;
-}
-
-/**
  * d_drop - drop a dentry
  * @dentry: dentry to drop
  *
@@ -545,7 +493,30 @@ relock:
 	dentry_lru_del(dentry);
 	/* if it was on the hash then remove it */
 	__d_drop(dentry);
-	return d_kill(dentry, parent);
+	list_del(&dentry->d_child);
+	/*
+	 * Inform d_walk() that we are no longer attached to the
+	 * dentry tree
+	 */
+	dentry->d_flags |= DCACHE_DENTRY_KILLED;
+	if (parent)
+		spin_unlock(&parent->d_lock);
+	dentry_iput(dentry);
+	/*
+	 * dentry_iput drops the locks, at which point nobody (except
+	 * transient RCU lookups) can reach this dentry.
+	 */
+	BUG_ON((int)dentry->d_lockref.count > 0);
+	this_cpu_dec(nr_dentry);
+	if (dentry->d_op && dentry->d_op->d_release)
+		dentry->d_op->d_release(dentry);
+
+	/* if dentry was never visible to RCU, immediate free is OK */
+	if (!(dentry->d_flags & DCACHE_RCUACCESS))
+		__d_free(&dentry->d_u.d_rcu);
+	else
+		call_rcu(&dentry->d_u.d_rcu, __d_free);
+	return parent;
 }
 
 /* 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3.14] fold d_kill() and d_free()
  2015-05-21  0:31     ` [PATCH 3.14] " Vinson Lee
  2015-05-21  0:31       ` [PATCH] " Vinson Lee
@ 2015-06-29 23:56       ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-06-29 23:56 UTC (permalink / raw)
  To: Vinson Lee; +Cc: Cong Wang, viro, stable, linux-fsdevel, Vinson Lee

On Wed, May 20, 2015 at 05:31:58PM -0700, Vinson Lee wrote:
> From: Vinson Lee <vlee@twitter.com>
> 
> This is a backport of 03b3b889e79cdb6b806fc0ba9be0d71c186bbfaa "fold 
> d_kill() and d_free()" to stable kernel 3.14.
> 
> The other 15 patches (patches 2-16) from the "vfs: fix dentry shrink 
> list corruption" stable request still apply on top of 3.14.43.

What stable request?

I don't see thos in my queue, what is this all supposed to be fixing?

Context please, I have none.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-29 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1415302640-5876-1-git-send-email-xiyou.wangcong@gmail.com>
     [not found] ` <1415302640-5876-2-git-send-email-xiyou.wangcong@gmail.com>
2015-05-18 17:44   ` [Patch 3.14 stable 01/16] fold d_kill() and d_free() Greg KH
2015-05-21  0:31     ` [PATCH 3.14] " Vinson Lee
2015-05-21  0:31       ` [PATCH] " Vinson Lee
2015-06-29 23:56       ` [PATCH 3.14] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).