public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Sachanowicz <analyzer1@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Marcin Pilipczuk <marcin.pilipczuk@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] proc: proc_get_inode should de_put when inode already initialized
Date: Mon, 23 Feb 2009 22:21:55 +0100	[thread overview]
Message-ID: <200902232221.55714.analyzer1@gmail.com> (raw)

de_get is called before every proc_get_inode, but corresponding de_put is 
called only when dropping last reference to an inode. This might cause 
something like
remove_proc_entry: /proc/stats busy, count=14496
to be printed to the syslog.

The fix is to call de_put in case of an already initialized inode in 
proc_get_inode.

Signed-off-by: Krzysztof Sachanowicz <analyzer1@gmail.com>
Tested-by: Marcin Pilipczuk <marcin.pilipczuk@gmail.com>
---
--- linux-2.6.29-rc6.orig/fs/proc/inode.c	2009-02-23 20:43:32.000000000 +0100
+++ linux-2.6.29-rc6/fs/proc/inode.c	2009-02-23 20:46:37.000000000 +0100
@@ -485,8 +485,10 @@ struct inode *proc_get_inode(struct supe
 			}
 		}
 		unlock_new_inode(inode);
-	} else
+	} else {
 	       module_put(de->owner);
+	       de_put(de);
+	}
 	return inode;
 
 out_ino:

             reply	other threads:[~2009-02-23 21:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23 21:21 Krzysztof Sachanowicz [this message]
2009-02-23 23:25 ` [PATCH] proc: proc_get_inode should de_put when inode already initialized Andrew Morton
2009-02-23 23:56   ` Krzysztof Sachanowicz
2009-02-24  7:07   ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902232221.55714.analyzer1@gmail.com \
    --to=analyzer1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.pilipczuk@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox