From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: gregkh@suse.de, petero2@telia.com, linux-kernel@vger.kernel.org
Subject: [PATCH] fix pktcdvd breakage from commit e105b8bfc769b0545b6f0f395179d1e43cbee822
Date: Sun, 30 Nov 2008 12:19:09 +0000 [thread overview]
Message-ID: <20081130121909.GV28946@ZenIV.linux.org.uk> (raw)
device_create() will create a symlink in /sys/dev/char unless
the class has ->dev_kobj cleared; pktcdvd uses it to populate the
/sys/class/pktcdvd/ with per-device subdirectories. While we do
want /sys/class/pktcdvd/pktcdvd[0-7]/dev to contain a device number,
we definitely do not want it to try and crap into /sys/dev/char; if
nothing else, device number is *block* one (and we don't want it
to crap into /sys/dev/block either - there such symlinks will be created
by add_disk() and they will point to /sys/block/pktcdvd[0-7]).
As it is, attempt to set the damn thing up will end up with
sysfs_add_one() barfing at duplicate entries and /sys/class/pktcdvd/pktcdvd*/*/
not created at all. The fix is trivial: clear ->dev_kobj in the class to
tell device_add() that no, we do *not* want these symlinks, TYVM...
FWIW, all traces containing pkt_setup_dev() on kerneloops.org appear
to be from that one. It had been around since 2.6.26; probably -stable
fodder...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index f20bf35..79981f2 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -417,6 +417,7 @@ static int pkt_sysfs_init(void)
printk(DRIVER_NAME": failed to create class pktcdvd\n");
return ret;
}
+ class_pktcdvd->dev_kobj = NULL;
return 0;
}
next reply other threads:[~2008-11-30 12:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-30 12:19 Al Viro [this message]
2008-11-30 12:41 ` [PATCH] fix pktcdvd breakage from commit e105b8bfc769b0545b6f0f395179d1e43cbee822 Kay Sievers
2008-11-30 13:21 ` Al Viro
2008-11-30 13:25 ` Kay Sievers
2008-11-30 13:32 ` Al Viro
2008-11-30 13:40 ` Al Viro
2008-11-30 13:44 ` Kay Sievers
2008-11-30 13:50 ` Al Viro
2008-11-30 13:57 ` Kay Sievers
2008-11-30 14:13 ` Al Viro
2008-11-30 14:28 ` Kay Sievers
2008-11-30 14:52 ` Al Viro
2008-11-30 15:53 ` Al Viro
2008-11-30 15:56 ` Kay Sievers
2008-12-05 2:57 ` Kay Sievers
2008-12-06 3:38 ` Kay Sievers
2008-12-09 21:57 ` Peter Osterlund
2008-11-30 13:41 ` Kay Sievers
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=20081130121909.GV28946@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=petero2@telia.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