All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] proc-avoid-extra-pde_put-in-proc_fill_super.patch removed from -mm tree
@ 2013-02-27 20:50 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2013-02-27 20:50 UTC (permalink / raw)
  To: mpatlasov, viro, mm-commits


The patch titled
     Subject: proc: avoid extra pde_put() in proc_fill_super()
has been removed from the -mm tree.  Its filename was
     proc-avoid-extra-pde_put-in-proc_fill_super.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Maxim Patlasov <mpatlasov@parallels.com>
Subject: proc: avoid extra pde_put() in proc_fill_super()

If proc_get_inode() succeeded, but d_make_root() failed, pde_put() for
proc_root will be called twice: the first time due to iput() called from
d_make_root() and the second time directly in the end of
proc_fill_super().

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/proc/inode.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff -puN fs/proc/inode.c~proc-avoid-extra-pde_put-in-proc_fill_super fs/proc/inode.c
--- a/fs/proc/inode.c~proc-avoid-extra-pde_put-in-proc_fill_super
+++ a/fs/proc/inode.c
@@ -486,6 +486,8 @@ struct inode *proc_get_inode(struct supe
 
 int proc_fill_super(struct super_block *s)
 {
+	struct inode *root_inode;
+
 	s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC;
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
@@ -494,11 +496,18 @@ int proc_fill_super(struct super_block *
 	s->s_time_gran = 1;
 	
 	pde_get(&proc_root);
-	s->s_root = d_make_root(proc_get_inode(s, &proc_root));
-	if (s->s_root)
-		return 0;
+	root_inode = proc_get_inode(s, &proc_root);
+	if (!root_inode) {
+		printk(KERN_ERR "proc_fill_super: get root inode failed\n");
+		pde_put(&proc_root);
+		return -ENOMEM;
+	}
+
+	s->s_root = d_make_root(root_inode);
+	if (!s->s_root) {
+		printk(KERN_ERR "proc_fill_super: allocate dentry failed\n");
+		return -ENOMEM;
+	}
 
-	printk("proc_read_super: get root inode failed\n");
-	pde_put(&proc_root);
-	return -ENOMEM;
+	return 0;
 }
_

Patches currently in -mm which might be from mpatlasov@parallels.com are

origin.patch
linux-next.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-27 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 20:50 [merged] proc-avoid-extra-pde_put-in-proc_fill_super.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.