mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Felipe Alfaro Solana <felipe_alfaro@linuxmail.org>
Cc: rmk@arm.linux.org.uk, linux-kernel@vger.kernel.org, davej@suse.de
Subject: Re: 2.5.69-mm5: pccard oops while booting: resolved
Date: Thu, 15 May 2003 16:00:15 -0700	[thread overview]
Message-ID: <20030515160015.5dfea63f.akpm@digeo.com> (raw)
In-Reply-To: <1053037915.569.2.camel@teapot.felipe-alfaro.com>

Felipe Alfaro Solana <felipe_alfaro@linuxmail.org> wrote:
>
> The test kernel is
> a 2.5.69-mm5 with the "i8259-shutdown.patch" reverted, plus the above
> patch and your previous "verbose" patch. Attached to this message is the
> new "dmesg" from this patched kernel.
> 
> As I told Andrew, reverting "make-KOBJ_NAME-match-BUS_ID_SIZE.patch"
> solves the oops.

The weird thing is that this patch really doesn't do anything apart from
increasing KOBJ_NAME_LEN from 16 to 20.





From: Ben Collins <bcollins@debian.org>

This was causing me all sorts of problems with linux1394's 16-18 byte long
bus_id lengths.  The sysfs names were all broken.

This not only makes KOBJ_NAME_LEN match BUS_ID_SIZE, but fixes the
strncpy's in drivers/base/ so that it can't happen again (at least the
strings will be null terminated).



 drivers/base/bus.c      |    2 ++
 drivers/base/class.c    |    2 ++
 drivers/base/core.c     |    1 +
 include/linux/device.h  |    2 +-
 include/linux/kobject.h |    2 +-
 5 files changed, 7 insertions(+), 2 deletions(-)

diff -puN drivers/base/bus.c~make-KOBJ_NAME-match-BUS_ID_SIZE drivers/base/bus.c
--- 25/drivers/base/bus.c~make-KOBJ_NAME-match-BUS_ID_SIZE	2003-05-14 19:18:09.000000000 -0700
+++ 25-akpm/drivers/base/bus.c	2003-05-14 19:18:09.000000000 -0700
@@ -432,6 +432,7 @@ int bus_add_driver(struct device_driver 
 		pr_debug("bus %s: add driver %s\n",bus->name,drv->name);
 
 		strncpy(drv->kobj.name,drv->name,KOBJ_NAME_LEN);
+		drv->kobj.name[KOBJ_NAME_LEN-1] = '\0';
 		drv->kobj.kset = &bus->drivers;
 
 		if ((error = kobject_register(&drv->kobj))) {
@@ -541,6 +542,7 @@ struct bus_type * find_bus(char * name)
 int bus_register(struct bus_type * bus)
 {
 	strncpy(bus->subsys.kset.kobj.name,bus->name,KOBJ_NAME_LEN);
+	bus->subsys.kset.kobj.name[KOBJ_NAME_LEN-1] = '\0';
 	subsys_set_kset(bus,bus_subsys);
 	subsystem_register(&bus->subsys);
 
diff -puN drivers/base/class.c~make-KOBJ_NAME-match-BUS_ID_SIZE drivers/base/class.c
--- 25/drivers/base/class.c~make-KOBJ_NAME-match-BUS_ID_SIZE	2003-05-14 19:18:09.000000000 -0700
+++ 25-akpm/drivers/base/class.c	2003-05-14 19:18:09.000000000 -0700
@@ -89,6 +89,7 @@ int class_register(struct class * cls)
 	INIT_LIST_HEAD(&cls->interfaces);
 	
 	strncpy(cls->subsys.kset.kobj.name,cls->name,KOBJ_NAME_LEN);
+	cls->subsys.kset.kobj.name[KOBJ_NAME_LEN-1] = '\0';
 	subsys_set_kset(cls,class_subsys);
 	subsystem_register(&cls->subsys);
 
@@ -259,6 +260,7 @@ int class_device_add(struct class_device
 
 	/* first, register with generic layer. */
 	strncpy(class_dev->kobj.name, class_dev->class_id, KOBJ_NAME_LEN);
+	class_dev->kobj.name[KOBJ_NAME_LEN-1] = '\0';
 	kobj_set_kset_s(class_dev, class_obj_subsys);
 	if (parent)
 		class_dev->kobj.parent = &parent->subsys.kset.kobj;
diff -puN drivers/base/core.c~make-KOBJ_NAME-match-BUS_ID_SIZE drivers/base/core.c
--- 25/drivers/base/core.c~make-KOBJ_NAME-match-BUS_ID_SIZE	2003-05-14 19:18:09.000000000 -0700
+++ 25-akpm/drivers/base/core.c	2003-05-14 19:18:09.000000000 -0700
@@ -214,6 +214,7 @@ int device_add(struct device *dev)
 
 	/* first, register with generic layer. */
 	strncpy(dev->kobj.name,dev->bus_id,KOBJ_NAME_LEN);
+	dev->kobj.name[KOBJ_NAME_LEN-1] = '\0';
 	kobj_set_kset_s(dev,devices_subsys);
 	if (parent)
 		dev->kobj.parent = &parent->kobj;
diff -puN include/linux/kobject.h~make-KOBJ_NAME-match-BUS_ID_SIZE include/linux/kobject.h
--- 25/include/linux/kobject.h~make-KOBJ_NAME-match-BUS_ID_SIZE	2003-05-14 19:18:09.000000000 -0700
+++ 25-akpm/include/linux/kobject.h	2003-05-14 19:18:09.000000000 -0700
@@ -12,7 +12,7 @@
 #include <linux/rwsem.h>
 #include <asm/atomic.h>
 
-#define KOBJ_NAME_LEN	16
+#define KOBJ_NAME_LEN	20
 
 struct kobject {
 	char			name[KOBJ_NAME_LEN];
diff -puN include/linux/device.h~make-KOBJ_NAME-match-BUS_ID_SIZE include/linux/device.h
--- 25/include/linux/device.h~make-KOBJ_NAME-match-BUS_ID_SIZE	2003-05-14 19:18:09.000000000 -0700
+++ 25-akpm/include/linux/device.h	2003-05-14 19:18:16.000000000 -0700
@@ -35,7 +35,7 @@
 #define DEVICE_NAME_SIZE	50
 #define DEVICE_NAME_HALF	__stringify(20)	/* Less than half to accommodate slop */
 #define DEVICE_ID_SIZE		32
-#define BUS_ID_SIZE		20
+#define BUS_ID_SIZE		KOBJ_NAME_LEN
 
 
 enum {

_


  reply	other threads:[~2003-05-15 22:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-15  2:03 Felipe Alfaro Solana
2003-05-15  2:17 ` Andrew Morton
2003-05-15 11:36   ` Felipe Alfaro Solana
2003-05-15 12:00     ` Russell King
2003-05-15 13:16       ` Felipe Alfaro Solana
2003-05-15 13:44         ` Russell King
2003-05-15 13:47           ` Dave Jones
2003-05-15 22:31           ` Felipe Alfaro Solana
2003-05-15 23:00             ` Andrew Morton [this message]
2003-05-16 13:03               ` Felipe Alfaro Solana
2003-05-16 18:13                 ` Ben Collins
2003-05-16 19:03                   ` Felipe Alfaro Solana
2003-05-16 18:34                 ` 2.5.69-mm6: pccard oops while booting Felipe Alfaro Solana
2003-05-16 20:29                   ` Andrew Morton
2003-05-16 21:42                     ` Felipe Alfaro Solana
2003-05-16 22:08                       ` Carl-Daniel Hailfinger
2003-05-16 23:40                         ` Felipe Alfaro Solana
2003-05-16 23:55                           ` Russell King
2003-05-17  0:03                             ` Felipe Alfaro Solana
2003-05-17  0:27                             ` Carl-Daniel Hailfinger
2003-05-17 10:11                         ` 2.5.69-mm6: pccard oops while booting: round 2 Felipe Alfaro Solana
2003-05-17 10:18                           ` Andrew Morton
2003-05-17 11:05                             ` Felipe Alfaro Solana
2003-05-17 11:22                               ` Carl-Daniel Hailfinger
2003-05-17 12:51                                 ` 2.5.69-mm6: pccard oops while booting: round 3 Felipe Alfaro Solana
2003-05-18 19:38                                   ` 2.5.69-mm6: pccard oops while booting: gcc bug? Felipe Alfaro Solana
2003-05-22 13:24                                     ` [RFC] Disallow compilation with gcc 3.2.3 (was: Re: 2.5.69-mm6: pccard oops while booting:) Carl-Daniel Hailfinger
2003-05-22 14:05                                       ` Valdis.Kletnieks
2003-05-22 18:34                                       ` Felipe Alfaro Solana
2003-05-22 19:24                                       ` Andrew Morton
2003-05-22 14:26                                     ` 2.5.69-mm6: pccard oops while booting: gcc bug? Russell King
2003-05-17 11:39                               ` 2.5.69-mm6: pccard oops while booting: round 2 Andrew Morton
2003-05-17 12:36                                 ` Felipe Alfaro Solana
2003-05-15 12:13     ` 2.5.69-mm5: pccard oops while booting: resolved Russell King

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=20030515160015.5dfea63f.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=davej@suse.de \
    --cc=felipe_alfaro@linuxmail.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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

Powered by JetHome