From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Date: Thu, 18 Jan 2001 22:45:47 +0000 Subject: Re: SCSI Patches - mostly on/off-line stuff Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org > directory notification capability in lk 2.4 (see > Documentation/dnotify.txt) could then be used to detect > changes in the /dev directory (or below). Why ? Devfs will call devfsd on its own. > A user mode notification daemon could read /proc/scsi/scsi > periodically to detect the arrival and departure of SCSI No ! This must not be done. Parsing /proc/scsi/scsi or for that matter any other file in /proc by a user space demon is a race condition. There's nothing you can do to change that. There's no way you could guarantee that the information gained by parsing is still valid when you use it. The coordination of a new device to a major/minor (or name) must be made in kernel space and cannot be broken until the user mode helper returns. Either devfs is used to do that or new event types are added to the /sbin/hotplug mechanism. For SCSI you'd need it in the bus scanning code and in the partition recognition code. As this is a larger undertaking, this would indicate IMHO that it'd be wiser to use the infrastructure contained in devfs. But there are other possibilities, however it must be done in kernel space. Regards Oliver _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel