From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: i_mutex locking in generic_file_splice_write() Date: Fri, 13 Oct 2006 10:18:56 +0200 Message-ID: <20061013081855.GG6515@kernel.dk> References: <20061012190152.GU6485@ca-server1.us.oracle.com> <20061012125409.40bd1fb1.akpm@osdl.org> <20061013001715.GV6485@ca-server1.us.oracle.com> <20061013074516.GY6515@kernel.dk> <20061013011129.42a757fb.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Mark Fasheh , linux-fsdevel@vger.kernel.org, Michael Halcrow Return-path: Received: from brick.kernel.dk ([62.242.22.158]:52286 "EHLO kernel.dk") by vger.kernel.org with ESMTP id S1750701AbWJMISm (ORCPT ); Fri, 13 Oct 2006 04:18:42 -0400 To: Andrew Morton Content-Disposition: inline In-Reply-To: <20061013011129.42a757fb.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Oct 13 2006, Andrew Morton wrote: > On Fri, 13 Oct 2006 09:45:17 +0200 > Jens Axboe wrote: > > > > Compile tested only. I probably won't get a chance to actually run it until > > > late this weekend at the earliest :/ > > > > Patch looks ok to me. The double lock test only works, as long as splice > > is the only one ever locking both mutexes. Or if others follow the same > > ordering rules. I'm not very well versed in vfs matters, is that > > guarenteed? > > Taking the lowest-addressed lock first is the usual convention, if we really > have to do that. I'm not aware of anywhere else where we pull this > trick with i_mutex though. It is, but people had concerns with that approach when it was originally done for pipe tee'ing. Things like lock_rename() look scary. -- Jens Axboe