From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch] loop.c to use write ops for fs requiring special locking Date: Wed, 1 Mar 2006 14:09:02 -0800 Message-ID: <20060301140902.53350bb6.akpm@osdl.org> References: <1141231737.15117.88.camel@technetium.msp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, aia21@cam.ac.uk Return-path: Received: from smtp.osdl.org ([65.172.181.4]:27882 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751301AbWCAWHG (ORCPT ); Wed, 1 Mar 2006 17:07:06 -0500 To: Robert S Peterson In-Reply-To: <1141231737.15117.88.camel@technetium.msp.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Robert S Peterson wrote: > > Hi All, > > Below is a small patch to loop.c I'd like to see in the kernel. > > This is an extension of Anton Altaparmakov's previous fix which allows > loop.c to use the aop->write rather than prepare_write/commit_write if > prepare_write/commit_write aren't available. There's a reason why we must use prepare_write/commit_write rather than ->write() and ow-ow-my-brain-hurts I can't remember what it was. Anton, do you recall? > Right now, the current loop.c uses aop->prepare_write/commit_write > unless there is no other option. However, due to special locking > requirements, some backing filesystems may prefer the use of aop->write > rather than prepare_write/commit_write. Since loop.c does not have > advisory locking, the backing fs should have a choice of which to use. > > In the case of GFS, for example, loop.c's use of aop->prepare_write > circumvents proper cluster locking and transaction building, so using > aop->write is the right thing for loop.c to do. > > How the patch works: > If the backing filesystem has special locking requirements (new flag in > fs_flags) loop.c uses aop->write rather than prepare_write/commit_write. > I think you'll find that cryptoloop doesn't work (see "ow-ow", above). > --- linux-2.6.15.4.orig/drivers/block/loop.c 2006-02-10 > 01:22:48.000000000 -0600 > +++ linux-2.6.15.4.patched/drivers/block/loop.c 2006-03-01 > 09:38:48.000000000 -0600 (The patch is wordwrapped)