From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755615AbZEWWsS (ORCPT ); Sat, 23 May 2009 18:48:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752926AbZEWWsL (ORCPT ); Sat, 23 May 2009 18:48:11 -0400 Received: from mail-fx0-f168.google.com ([209.85.220.168]:59909 "EHLO mail-fx0-f168.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbZEWWsL convert rfc822-to-8bit (ORCPT ); Sat, 23 May 2009 18:48:11 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Kay Sievers Date: Sun, 24 May 2009 00:47:51 +0200 Message-ID: Subject: Re: How to tell whether a struct file is held by a process? To: Alan Stern Cc: Alan Cox , Kyle Moffett , Pantelis Koukousoulas , Al Viro , Kernel development list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 23, 2009 at 00:07, Alan Stern wrote: >> Can't we just add ioctls to the hub device >> nodes to implement the locking? > > Yes, that would work.  Closing the hub device file would release all > the locked ports. > > It wouldn't leave any lock files for user programs.  They would have to > arrange the locking among themselves somehow.  Would that be okay? I would expect that userspace drivers competing about raw USB devices wouldn't be that common. And I guess, most of these problems can probably be solved by simple file permissions/ACLs applied to the USB device nodes, in the same way the access to the hub device node would be granted to lock-out the kernel drivers. Kay