From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbXAKUob (ORCPT ); Thu, 11 Jan 2007 15:44:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751511AbXAKUob (ORCPT ); Thu, 11 Jan 2007 15:44:31 -0500 Received: from omx2-ext.sgi.com ([192.48.171.19]:34209 "EHLO omx2.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751514AbXAKUoa (ORCPT ); Thu, 11 Jan 2007 15:44:30 -0500 Message-ID: <45A6A17F.6080002@sgi.com> Date: Thu, 11 Jan 2007 14:43:43 -0600 From: Michael Reed User-Agent: Thunderbird 1.5.0.9 (X11/20060911) MIME-Version: 1.0 To: Andrew Morton CC: "Chen, Kenneth W" , "'Zach Brown'" , "'Chris Mason'" , Christoph Hellwig , linux-kernel , Jeremy Higdon , David Chinner Subject: Re: [patch] optimize o_direct on block device - v3 References: <000101c7198d$9a9fde40$ff0da8c0@amr.corp.intel.com> <45A68E55.10601@sgi.com> <20070111112901.28085adf.akpm@osdl.org> In-Reply-To: <20070111112901.28085adf.akpm@osdl.org> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Andrew Morton wrote: > On Thu, 11 Jan 2007 13:21:57 -0600 > Michael Reed wrote: > >> Testing on my ia64 system reveals that this patch introduces a >> data integrity error for direct i/o to a block device. Device >> errors which result in i/o failure do not propagate to the >> process issuing direct i/o to the device. >> >> This can be reproduced by doing writes to a fibre channel block >> device and then disabling the switch port connecting the host >> adapter to the switch. >> > > Does this fix it? > Yes it does! Thank you for finding this so quickly. Mike > > > > > diff -puN fs/block_dev.c~a fs/block_dev.c > --- a/fs/block_dev.c~a > +++ a/fs/block_dev.c > @@ -146,7 +146,7 @@ static int blk_end_aio(struct bio *bio, > iocb->ki_nbytes = -EIO; > > if (atomic_dec_and_test(bio_count)) { > - if (iocb->ki_nbytes < 0) > + if ((long)iocb->ki_nbytes < 0) > aio_complete(iocb, iocb->ki_nbytes, 0); > else > aio_complete(iocb, iocb->ki_left, 0); > _ > >