From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757328AbZEVNwa (ORCPT ); Fri, 22 May 2009 09:52:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753043AbZEVNwX (ORCPT ); Fri, 22 May 2009 09:52:23 -0400 Received: from mail-bw0-f174.google.com ([209.85.218.174]:36330 "EHLO mail-bw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752763AbZEVNwX (ORCPT ); Fri, 22 May 2009 09:52:23 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=C4VFpe8juO/GQzZ3T+1fuBkiJfXIYTdcEs/N0ERkuK1TCKMVi9lSK1nR52VBCkoVvd fzhxlKZmTufxpL2sVAIAHWpVdtG33baOH2M9YxdnVcBcVtgdsPmcG0HWTadiMyYbwVsG qxiIJvTa4c1hnORmXgAd9gHeZVHLzsS4UfrUc= MIME-Version: 1.0 In-Reply-To: <20090522144343.7b26b3a8@lxorguk.ukuu.org.uk> References: <1295ed070905220630q67c62569o9753425abf529742@mail.gmail.com> <20090522144343.7b26b3a8@lxorguk.ukuu.org.uk> Date: Fri, 22 May 2009 16:52:23 +0300 Message-ID: <1295ed070905220652q55c65e8bx992940b626eecda3@mail.gmail.com> Subject: Re: How to tell whether a struct file is held by a process? From: Pantelis Koukousoulas To: Alan Cox Cc: Kernel development list , Kay Sievers , Al Viro , Alan Stern Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 22, 2009 at 4:43 PM, Alan Cox wrote: >> Suppose a device needs a reset as part of its init sequence (a whole lot >> of them do, this is not purely hypothetical). Then a different process may >> get to operate the device before and after the reset and hilarity may result >> from that. > > Thats surely up to you to get your lock file usage right. The kernel > isn't there to play mother to crap programming. Who is "me" in this case? Assuming that those writing the userspace programs are cooperative though, I agree. We can declare that whatever program does not play by the (userspace locking) rules is crap and either fix it (if open source) or refuse to install it / complain (if closed source). > >> So, if there is a clean / acceptable way to handle the reset issue in userspace > > Firstly can you explain *why* you think there is a problem ? > I admit this could be a bias from the way I imagined the whole thing to work before this discussion. I think I can see how a userspace locking scheme based on port numbers could avoid also the reset problem. Thanks, Pantelis