Return-Path: Received: from mx2.netapp.com ([216.240.18.37]:47971 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752838Ab1ASX5H convert rfc822-to-8bit (ORCPT ); Wed, 19 Jan 2011 18:57:07 -0500 Subject: Re: [PATCH] NFS: Fix "BUG at fs/aio.c:554!" From: Trond Myklebust To: Nick Piggin Cc: Chuck Lever , linux-fsdevel@vger.kernel.org, Linux NFS Mailing List , Wengang Wang In-Reply-To: References: <20110119223543.30706.10304.stgit@matisse.1015granger.net> <1295479517.22151.16.camel@heimdal.trondhjem.org> <1295479900.22151.19.camel@heimdal.trondhjem.org> <1CB6BE0E-01BA-47E6-BBD1-298F62735DF6@oracle.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 19 Jan 2011 18:56:14 -0500 Message-ID: <1295481374.22151.28.camel@heimdal.trondhjem.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 On Thu, 2011-01-20 at 10:42 +1100, Nick Piggin wrote: > On Thu, Jan 20, 2011 at 10:39 AM, Chuck Lever wrote: > > > > On Jan 19, 2011, at 6:37 PM, Nick Piggin wrote: > > > >> On Thu, Jan 20, 2011 at 10:31 AM, Trond Myklebust > >> wrote: > >>> On Thu, 2011-01-20 at 10:26 +1100, Nick Piggin wrote: > >>>> On Thu, Jan 20, 2011 at 10:25 AM, Trond Myklebust > >> > >>>>> Also, why is EIO the correct reply when no bytes were read/written? Why > >>>>> shouldn't the VFS aio code be able to cope with a zero byte reply? > >>>> > >>>> What would it do? > >>> > >>> Just return that zero byte reply to userland. > >>> > >>> zero bytes is a valid reply for ordinary read() and write(), so why > >>> should we have to do anything different for aio_read()/aio_write()? > >> > >> It doesn't give userspace much to do. zero reply from read means > >> EOF. Zero reply from write is pretty useless, I don't think we do it > >> in the buffered write path -- we either ensure we write at least > >> something or have a meaningful error to return. > > > > I think in this case, the zero-length requests are already shunted off. No zero-length requests make it down here, IIRC. So we expect that either some bytes are started, or an error occurs. If zero bytes were started and no error occurred, that's just... wrong. > > Right. So in this case you should have an error to return. So, which error??? What is going wrong that ensures that we don't start any I/O. Is it the pages that are failing to fault in, is it the RPC call that is failing to start (if so, why)? I don't like to be returning EIO if a more specific (and useful) error exists. -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com