Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755229AbYK3O21 (ORCPT ); Sun, 30 Nov 2008 09:28:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751580AbYK3O2R (ORCPT ); Sun, 30 Nov 2008 09:28:17 -0500 Received: from ey-out-2122.google.com ([74.125.78.25]:33248 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbYK3O2R (ORCPT ); Sun, 30 Nov 2008 09:28:17 -0500 Message-ID: Date: Sun, 30 Nov 2008 15:28:15 +0100 From: "Kay Sievers" To: "Al Viro" Subject: Re: [PATCH] fix pktcdvd breakage from commit e105b8bfc769b0545b6f0f395179d1e43cbee822 Cc: "Linus Torvalds" , gregkh@suse.de, petero2@telia.com, linux-kernel@vger.kernel.org In-Reply-To: <20081130141329.GC28946@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081130121909.GV28946@ZenIV.linux.org.uk> <20081130132118.GY28946@ZenIV.linux.org.uk> <20081130133229.GZ28946@ZenIV.linux.org.uk> <20081130134048.GA28946@ZenIV.linux.org.uk> <20081130135031.GB28946@ZenIV.linux.org.uk> <20081130141329.GC28946@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 39 On Sun, Nov 30, 2008 at 15:13, Al Viro wrote: > On Sun, Nov 30, 2008 at 02:57:14PM +0100, Kay Sievers wrote: >> > "It" being udev, presumably? >> >> Yes, udev, mdev, and a few other tools people use to populate /dev >> from the kernel supplied device information. >> >> > What a mess... How does drivers/usb/core/devio.c avoid essentially the same >> > problem? >> >> It's a special case, where two "struct device" have the same dev_t, >> but they both point to and handle the same device, so it's fine. The >> usb_device class is deprecated, no recent distro uses it, and will be >> removed some day. > > Would that happened to udev as well... Yeah, I know, but one can dream ;-/ If there are two devices with the same dev_t, and udev is configured to create the same names in /dev, it will create the node for the first event, and reuse is for the second identical event. There is no problem here. > Bloody wonderful. So we have > * userland-exposed layout of directory trees created by pktcdvd > * uevent mess generated by device_create() and *also* userland-exposed > > 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. Kay -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/