Re: How to tell whether a struct file is held by a process?

From: Kay Sievers
Date: Fri May 22 2009 - 11:21:48 EST


On Fri, May 22, 2009 at 17:12, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> Anyway, enumeration isn't the problem. ÂThe real problem has two parts:
>
> Â Â Â ÂAutomatic probing and binding of kernel drivers, including
> Â Â Â Âselection and installation of a configuration (this really
> Â Â Â Â_does_ mess up virtualization).
>
> Â Â Â ÂThe fact that a window exists immediately after the
> Â Â Â Âregistration of a newly-detected device before a user
> Â Â Â Âprocess can lock the device file. ÂDuring this window,
> Â Â Â Âother processes could open the file.
>
> The second part can be solved (among cooperating processes) by use of
> port-lock files, with no kernel involvement. ÂThe first part does
> require a kernel interface of some sort, but it wouldn't have to be
> complicated. ÂThe mere fact that a port-lock file was open could be
> enough to prevent automatic configuration, probing, and binding.
>
> Does this seem like reasonable approach?

Would releasing the "lock" trigger a kernel-driver-binding call?

The lock will always lock all devices of a specific hub?

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/