From: Keiichi KII <k-keiichi@bx.jp.nec.com>
To: Satyam Sharma <ssatyam@cse.iitk.ac.in>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Matt Mackall <mpm@selenic.com>, Netdev <netdev@vger.kernel.org>,
Joel Becker <joel.becker@oracle.com>,
Stephen Hemminger <shemminger@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH v2 -mm 9/9] netconsole: Support dynamic reconfiguration using configfs
Date: Thu, 12 Jul 2007 19:04:40 +0900 [thread overview]
Message-ID: <4695FCB8.8090102@bx.jp.nec.com> (raw)
In-Reply-To: <20070710092006.23907.33652.sendpatchset@cselinux1.cse.iitk.ac.in>
Hi Satyam,
> struct netconsole_target {
> struct list_head list;
> +#ifdef CONFIG_NETCONSOLE_DYNAMIC
> + struct config_item item;
> + int enabled;
> +#endif
> struct netpoll np;
> };
If CONFIG_NETCONSOLE_DYNAMIC is unset, we can't access to the "enabled" member.
So, the compile errors occur because the following functions make use of
the above one.
> +/* Allocate new target (from boot/module param) and setup netpoll for it */
> +static struct netconsole_target *alloc_param_target(char *target_config)
> {
> int err = -ENOMEM;
> struct netconsole_target *nt;
>
> - /* Allocate and initialize with defaults */
> + /*
> + * Allocate and initialize with defaults.
> + * Note that these targets get their config_item fields zeroed-out.
> + */
> nt = kzalloc(sizeof(*nt), GFP_KERNEL);
> if (!nt) {
> printk(KERN_ERR "netconsole: failed to allocate memory\n");
> @@ -106,6 +188,8 @@ static struct netconsole_target *alloc_t
> if (err)
> goto fail;
>
> + nt->enabled = 1;
> +
> return nt;
>
> fail:
> @@ -113,13 +197,469 @@ fail:
> return ERR_PTR(err);
> }
> @@ -169,7 +711,8 @@ static void write_msg(struct console *co
>
> spin_lock_irqsave(&target_list_lock, flags);
> list_for_each_entry(nt, &target_list, list) {
> - if (netif_running(nt->np.dev)) {
> + netconsole_target_get(nt);
> + if (nt->enabled && netif_running(nt->np.dev)) {
> /*
> * We nest this inside the for-each-target loop above
> * so that we're able to get as much logging out to
> @@ -184,6 +727,7 @@ static void write_msg(struct console *co
> left -= frag;
> }
> }
> + netconsole_target_put(nt);
> }
> spin_unlock_irqrestore(&target_list_lock, flags);
> }
I created the following patch for performing some tests.
If there is nothing wrong with the patch, I'm going to continue to test.
Signed-off-by: Keiichi Kii <k-keiichi@bx.jp.nec.com>
Index: mm/drivers/net/netconsole.c
===================================================================
--- mm.orig/drivers/net/netconsole.c
+++ mm/drivers/net/netconsole.c
@@ -94,8 +94,8 @@ struct netconsole_target {
struct list_head list;
#ifdef CONFIG_NETCONSOLE_DYNAMIC
struct config_item item;
- int enabled;
#endif
+ int enabled;
struct netpoll np;
};
Thanks
--
Keiichi KII
NEC Corporation OSS Platform Development Division
E-mail: k-keiichi@bx.jp.nec.com
next prev parent reply other threads:[~2007-07-12 10:08 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 9:19 [RFC][PATCH v2 -mm 0/9] netconsole: Multiple targets and dynamic reconfigurability Satyam Sharma
2007-07-10 9:19 ` [PATCH v2 -mm 1/9] netconsole: Cleanups, codingstyle, prettyfication Satyam Sharma
2007-07-10 9:02 ` Matt Mackall
2007-07-13 13:40 ` KII Keiichi
2007-07-10 9:19 ` [PATCH v2 -mm 2/9] netconsole: Remove bogus check Satyam Sharma
2007-07-10 9:05 ` Matt Mackall
2007-07-13 13:41 ` KII Keiichi
2007-07-10 9:19 ` [PATCH v2 -mm 3/9] netconsole: Simplify boot/module option setup logic Satyam Sharma
2007-07-10 9:23 ` Matt Mackall
2007-07-13 13:42 ` KII Keiichi
2007-07-10 9:19 ` [PATCH v2 -mm 4/9] netconsole: Add some useful tips to documentation Satyam Sharma
2007-07-10 9:41 ` Matt Mackall
2007-07-10 12:34 ` Jesper Juhl
2007-07-10 22:10 ` Satyam Sharma
2007-07-11 4:20 ` Joel Becker
2007-07-11 6:05 ` Satyam Sharma
2007-07-11 11:56 ` Jesper Juhl
2007-07-10 9:19 ` [PATCH v2 -mm 5/9] netconsole: Introduce netconsole_target Satyam Sharma
2007-07-13 13:46 ` KII Keiichi
2007-07-10 9:19 ` [PATCH v2 -mm 6/9] netconsole: Introduce netconsole_netdev_notifier Satyam Sharma
2007-07-13 13:47 ` KII Keiichi
2007-07-10 9:19 ` [PATCH v2 -mm 7/9] netconsole: Use netif_running() in write_msg() Satyam Sharma
2007-07-13 13:48 ` KII Keiichi
2007-07-10 9:20 ` [PATCH v2 -mm 8/9] netconsole: Support multiple logging targets Satyam Sharma
2007-07-10 10:23 ` Duane Griffin
2007-07-10 22:17 ` Satyam Sharma
2007-07-11 4:29 ` Joel Becker
2007-07-11 6:24 ` Satyam Sharma
2007-07-13 13:49 ` KII Keiichi
2007-07-10 9:20 ` [PATCH v2 -mm 9/9] netconsole: Support dynamic reconfiguration using configfs Satyam Sharma
2007-07-12 10:04 ` Keiichi KII [this message]
2007-07-12 17:08 ` Satyam Sharma
2007-07-13 13:50 ` KII Keiichi
2007-07-11 9:59 ` [RFC][PATCH v2 -mm 0/9] netconsole: Multiple targets and dynamic reconfigurability Keiichi KII
2007-07-13 13:39 ` KII Keiichi
2007-07-13 17:30 ` Satyam Sharma
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=4695FCB8.8090102@bx.jp.nec.com \
--to=k-keiichi@bx.jp.nec.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=joel.becker@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=ssatyam@cse.iitk.ac.in \
/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 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.