mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix pktcdvd breakage from commit e105b8bfc769b0545b6f0f395179d1e43cbee822
Date: Tue, 9 Dec 2008 22:57:26 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.1.10.0812092252590.12990@quad.localdomain> (raw)
In-Reply-To: <1228534691.3428.1.camel@nga>

On Sat, 6 Dec 2008, Kay Sievers wrote:

> On Fri, 2008-12-05 at 03:57 +0100, Kay Sievers wrote:
>> On Sun, Nov 30, 2008 at 16:56, Kay Sievers <kay.sievers@vrfy.org> wrote:
>>> On Sun, Nov 30, 2008 at 15:52, Al Viro <viro@zeniv.linux.org.uk> wrote:
>>>> On Sun, Nov 30, 2008 at 03:28:15PM +0100, Kay Sievers wrote:
>>>>>> So we need to preserve the layout, with the easiest way probably being "add
>>>>>> one more ktype and use kobject_init_and_add() instead of that device_create()".
>>>>>> Sigh...
>>>>>
>>>>> What do you mean? We just need to replace the bogus "pd->pkt_dev" with
>>>>> MKDEV(0, 0) and we are fine.
>>>>
>>>> Userland-visible change - right now cat /sys/class/pktcdvd/pktcdvd3/dev will
>>>> give you dev_t of the block device in question.
>>>
>>> True, it's visible, but it's incorrect dead information which should
>>> be removed. Subsystem != "block is defined as S_IFCHR, and there is no
>>> such char device for pktcdvd. In fact the "dev" file of the pktcdvd
>>> class device points in many cases to a USB device, which must be
>>> fixed.
>>>
>>> The whole pktcdvd class is not used at all, besides for exporting a
>>> few files. The "dev" file at the class device is just a bug, and the
>>> MAJOR/MINOR uevent environment variables also. I doubt that there will
>>> be any visible breakage in something that isn't already totally
>>> broken. In short, I doubt, that anything that works today will stop
>>> working if we remove the bugus "dev" file.
>>>
>>> This seem like the simple and correct fix for the issue with /sys/dev/
>>> and the broken non-existing but exported pkcdvd char device:
>>> -               pd->dev = device_create(class_pktcdvd, NULL, pd->pkt_dev, NULL,
>>> +               pd->dev = device_create(class_pktcdvd, NULL, MKDEV(0, 0), NULL,
>>
>> Al, this bug still exists, right? Any objections to remove the dead char dev_t?
>
> Here is a patch.

I can confirm that this patch doesn't seem to cause any negative side 
effects on either pktsetup or pktcdvd, which are the only two user space 
programs I know of that care about the pktcdvd driver.

Acked-by: Peter Osterlund <petero2@telia.com>


> Thanks,
> Kay
>
>
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: pktcdvd: remove broken dev_t export of class devices
>
> The pktcdvd created class devices only export some sysfs files,
> but have no char dev_t registered in the driver.
>
> At class device creation time they copy the dev_t value of the
> block device to the char device, wich will register a new char
> device in the driver core and userspace, with a conflicting dev_t
> value.
>
> In many cases the class devices dev_t just points to a random
> USB device. This fixes the sysfs "duplicate entry" errors.
>
> Cc: petero2@telia.com
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> ---
> pktcdvd.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -302,7 +302,7 @@ static struct kobj_type kobj_pkt_type_wqueue = {
> static void pkt_sysfs_dev_new(struct pktcdvd_device *pd)
> {
> 	if (class_pktcdvd) {
> -		pd->dev = device_create(class_pktcdvd, NULL, pd->pkt_dev, NULL,
> +		pd->dev = device_create(class_pktcdvd, NULL, MKDEV(0, 0), NULL,
> 					"%s", pd->name);
> 		if (IS_ERR(pd->dev))
> 			pd->dev = NULL;

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

  reply	other threads:[~2008-12-09 23:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-30 12:19 Al Viro
2008-11-30 12:41 ` 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 [this message]
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=alpine.LFD.1.10.0812092252590.12990@quad.localdomain \
    --to=petero2@telia.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.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

all inboxes | Powered by JetHome®