On Tue, May 31, 2011 at 17:31, Tejun Heo <htejun@xxxxxxxxx> wrote: > On Mon, May 30, 2011 at 10:06:49PM +0200, Kay Sievers wrote: >> Yeah, the fake cdrom on the stick seems pretty broken. It generates >> media-changed events on very open(), and udev runs open() for the new >> event, which ... creates the loop you are seeing. > > Ugh... :-( > >> We need to find a way to work around such issues in the kernel, I guess. >> >> Tejun, any idea? > > Hmmm... a couple of questions. > > * udev doesn't open device w/ O_EXCL, right? Cdrom_id uses O_EXCL if the disk is not mounted. If it's mounted we obviously can't use O_EXCL and don't use it. If it's a data disk, we call blkid which does not use O_EXCL. > * Does a MEDIA_CHANGE event trigger multiple opens? Yeah, it can run multiple things against the drive. If it's a data cd it will run cdrom_id and blkid with the same event. > I _think_ if udev > Âopens only once, the event shouldn't be re-generated immediately. Yeah, but we can't assume only a single open() without making huge changes. > ÂIt will happen on the next poll interval but it won't be a busy > Âloop. This happens without the in-kernel polling enabled. Kay -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html