linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jan Kara <jack@suse.cz>
Cc: jrs@us.ibm.com, aneesh.kumar@linux.vnet.ibm.com,
	richard@rsk.demon.co.uk, sct@redhat.com,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: jbd : config_jbd_debug cannot create /proc entry
Date: Wed, 26 Sep 2007 14:35:39 -0700	[thread overview]
Message-ID: <20070926143539.b01bc0bc.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070925143608.GB18758@atrey.karlin.mff.cuni.cz>

On Tue, 25 Sep 2007 16:36:08 +0200
Jan Kara <jack@suse.cz> wrote:

> > On Tue, 25 Sep 2007 07:49:38 -0500
> > "Jose R. Santos" <jrs@us.ibm.com> wrote:
> > 
> > > On Tue, 25 Sep 2007 13:50:46 +0200
> > > Jan Kara <jack@ucw.cz> wrote:
> > > > > Jan Kara wrote:
> > > > > >>
> > > > > >-#define create_jbd_proc_entry() do {} while (0)
> > > > > >-#define remove_jbd_proc_entry() do {} while (0)
> > > > > >+static ctl_table fs_table[] = {
> > > > > >+	{
> > > > > >+                .ctl_name       = -1,	/* Don't want it */
> > > > > 
> > > > > 
> > > > > 
> > > > > shouldn't this be CTL_UNNUMBERED ?
> > > >   Oh, it should be. I didn't notice we have this :) Thanks for notifying
> > > > me. Attached is a fixed version.
> > > 
> > > This was fixed in JBD2 by moving the jbd-debug file to debugfs:
> > > http://lkml.org/lkml/2007/7/11/334
> > > 
> > > Since this code is already in the kernel, we should keep it consistent. 
> > > 
> > 
> > OK.  Here's a quick patch to fix this.  Adapted from the JBD2 patch.
> > Let me know what you think.
>   Looks fine - exactly what I've just done here :).

hm.  I found rather a lot of issues.  If this patch is derived from the
JBD2 patch then perhaps the JBD2 patch needs some looking at.

> >     Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
>   You can add Signed-off-by: Jan Kara <jack@suse.cz>

I suspect you might be getting your signed-off-bys and acked-bys mixed up. 
(If not this patch, then the previous one).  Please see
Documentation/SubmittingPatches section 13 for the difference.

Jose, please review and if possible runtime test these proposed changes?



From: Andrew Morton <akpm@linux-foundation.org>

- use `#ifdef foo' instead of `#if defined(foo)'

- CONFIG_JBD_DEBUG depends on CONFIG_DEBUG_FS so we don't need to duplicate
  that logic in the .c file ifdefs

- Make journal_enable_debug __read_mostly just for the heck of it

- Make jbd_debugfs_dir and jbd_debug static

- debugfs_remove(NULL) is legal: remove unneeded tests

- jbd_create_debugfs_entry is a better name than create_jbd_debugfs_entry

- ditto remove_jbd_debugfs_entry

- C functions are preferred over macros

Cc: "Jose R. Santos" <jrs@us.ibm.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


diff -puN fs/jbd/journal.c~jbd-config_jbd_debug-cannot-create-proc-entry-fix fs/jbd/journal.c
--- a/fs/jbd/journal.c~jbd-config_jbd_debug-cannot-create-proc-entry-fix
+++ a/fs/jbd/journal.c
@@ -1853,16 +1853,15 @@ void journal_put_journal_head(struct jou
 /*
  * debugfs tunables
  */
-#if defined(CONFIG_JBD_DEBUG)
-u8 journal_enable_debug;
-EXPORT_SYMBOL(journal_enable_debug);
-#endif
+#ifdef CONFIG_JBD_DEBUG
 
-#if defined(CONFIG_JBD_DEBUG) && defined(CONFIG_DEBUG_FS)
+u8 journal_enable_debug __read_mostly;
+EXPORT_SYMBOL(journal_enable_debug);
 
-struct dentry  *jbd_debugfs_dir, *jbd_debug;
+static struct dentry *jbd_debugfs_dir;
+static struct dentry *jbd_debug;
 
-static void __init create_jbd_debugfs_entry(void)
+static void __init jbd_create_debugfs_entry(void)
 {
 	jbd_debugfs_dir = debugfs_create_dir("jbd", NULL);
 	if (jbd_debugfs_dir)
@@ -1871,18 +1870,21 @@ static void __init create_jbd_debugfs_en
 					       &journal_enable_debug);
 }
 
-static void __exit remove_jbd_debugfs_entry(void)
+static void __exit jbd_remove_debugfs_entry(void)
 {
-	if (jbd_debug)
-		debugfs_remove(jbd_debug);
-	if (jbd_debugfs_dir)
-		debugfs_remove(jbd_debugfs_dir);
+	debugfs_remove(jbd_debug);
+	debugfs_remove(jbd_debugfs_dir);
 }
 
 #else
 
-#define create_jbd_debugfs_entry() do {} while (0)
-#define remove_jbd_debugfs_entry() do {} while (0)
+static inline void jbd_create_debugfs_entry(void)
+{
+}
+
+static inline void jbd_remove_debugfs_entry(void)
+{
+}
 
 #endif
 
@@ -1940,7 +1942,7 @@ static int __init journal_init(void)
 	ret = journal_init_caches();
 	if (ret != 0)
 		journal_destroy_caches();
-	create_jbd_debugfs_entry();
+	jbd_create_debugfs_entry();
 	return ret;
 }
 
@@ -1951,7 +1953,7 @@ static void __exit journal_exit(void)
 	if (n)
 		printk(KERN_EMERG "JBD: leaked %d journal_heads!\n", n);
 #endif
-	remove_jbd_debugfs_entry();
+	jbd_remove_debugfs_entry();
 	journal_destroy_caches();
 }
 
_

  reply	other threads:[~2007-09-26 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25  9:40 jbd : config_jbd_debug cannot create /proc entry richard kennedy
2007-09-25 10:51 ` Jan Kara
2007-09-25 11:04   ` Aneesh Kumar K.V
2007-09-25 11:50     ` Jan Kara
2007-09-25 12:49       ` Jose R. Santos
2007-09-25 13:41         ` Jose R. Santos
2007-09-25 14:36           ` Jan Kara
2007-09-26 21:35             ` Andrew Morton [this message]
2007-09-27  5:23               ` Jose R. Santos

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=20070926143539.b01bc0bc.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=jack@suse.cz \
    --cc=jrs@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@rsk.demon.co.uk \
    --cc=sct@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).