Skip to contentSkip to conversation

proc-ns: Use d_set_d_op() API to set dentry ops in proc_ns_instantiate().

PATCH In review Jesse Gross 3 participants 4 messages Mar 14, 2012 – Mar 22, 2012 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc-ns: Use d_set_d_op() API to set dentry ops in proc_ns_instantiate().

From: Pravin B Shelar <[email protected]>

Use d_set_d_op() so that DCACHE_OP_* flags are set correctly which fixes ns cleanup path i.e. ip netns delete .

This issue exists back to 3.0.

---
 fs/proc/namespaces.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/proc/namespaces.c +1 -1
index 27da860..3551f1f 100644
@@ -53,7 +53,7 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
 	ei->ns_ops    = ns_ops;
 	ei->ns	      = ns;
 
-	dentry->d_op = &pid_dentry_operations;
+	d_set_d_op(dentry, &pid_dentry_operations);
 	d_add(dentry, inode);
 	/* Close the race of the process dying before we return the dentry */
 	if (pid_revalidate(dentry, NULL))
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jesse Gross

From: Pravin B Shelar <[email protected]>

Use d_set_d_op() so that DCACHE_OP_* flags are set correctly which fixes ns cleanup path i.e. ip netns delete .

This issue exists back to 3.0.

Jesse thanks for picking this up and giving this a push. This is most
definitely the right fix and it most definitely solves issues. Somehow
this fix got lost when I sent it to Linus the first time.

Quoted 21 lines
---
 fs/proc/namespaces.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/proc/namespaces.c +1 -1
index 27da860..3551f1f 100644
@@ -53,7 +53,7 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
 	ei->ns_ops    = ns_ops;
 	ei->ns	      = ns;
 
-	dentry->d_op = &pid_dentry_operations;
+	d_set_d_op(dentry, &pid_dentry_operations);
 	d_add(dentry, inode);
 	/* Close the race of the process dying before we return the dentry */
 	if (pid_revalidate(dentry, NULL))
#2 lore raw
Quoted 7 lines · Eric W. Biederman
Quoted 5 lines · Jesse Gross

From: Pravin B Shelar <[email protected]>

Use d_set_d_op() so that DCACHE_OP_* flags are set correctly which fixes ns cleanup path i.e. ip netns delete .

Quoted 7 lines
Quoted 1 line

This issue exists back to 3.0.

Jesse thanks for picking this up and giving this a push.  This is most definitely the right fix and it most definitely solves issues.   Somehow this fix got lost when I sent it to Linus the first time.

Thanks Eric, I didn't realize that you had picked it up the first time around, which is why I figured that I'd try Andrew. I haven't heard anything from him so do you want to take it? (I'm not quite sure who owns this piece of code, sorry if it's already been handled.)

#3 lore raw
In reply to Jesse Gross
Quoted 6 lines · On Tue, 13 Mar 2012 19:08:17 -0700 Jesse Gross <[email protected]> wrote:

From: Pravin B Shelar <[email protected]>

Use d_set_d_op() so that DCACHE_OP_* flags are set correctly which fixes ns cleanup path i.e. ip netns delete .

This issue exists back to 3.0.

What does "fixes" mean? Please provide a full description of the user-visible impact of the bug, so that others can ascertain whether the patch will fix a problem which they're seeing and so that people like me can work out which kernel versions we should merge it into.

Thanks.