From: Trond Myklebust Subject: Re: Q. NFS, return value of close(2) Date: Wed, 11 Aug 2010 13:06:36 -0400 Message-ID: <1281546396.3262.7.camel@heimdal.trondhjem.org> References: <4387.1281540989@jrobl> <1281544299.3262.2.camel@heimdal.trondhjem.org> <7396.1281546264@jrobl> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: linux-fsdevel@vger.kernel.org To: "J. R. Okajima" Return-path: Received: from mx2.netapp.com ([216.240.18.37]:32965 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753502Ab0HKRG6 convert rfc822-to-8bit (ORCPT ); Wed, 11 Aug 2010 13:06:58 -0400 In-Reply-To: <7396.1281546264@jrobl> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2010-08-12 at 02:04 +0900, J. R. Okajima wrote: > Trond Myklebust: > > Yes. That looks correct. Can you resend with an appropriate signed-off > > line, etc.? > > Sure. Thank you! Applied... Trond > ---------------------------------------------------------------------- > commit e56f956a08a6227004cd9b7747df6a089dbb3594 > Author: J. R. Okajima > Date: Thu Aug 12 02:00:02 2010 +0900 > > NFS: fix the return value of nfs_file_fsync() > > By the commit > af7fa16 2010-08-03 NFS: Fix up the fsync code > close(2) became returning the non-zero value even if it went well. > nfs_file_fsync() should return 0 when "status" is positive. > > Signed-off-by: J. R. Okajima > > diff --git a/fs/nfs/file.c b/fs/nfs/file.c > index 2d141a7..eb51bd6 100644 > --- a/fs/nfs/file.c > +++ b/fs/nfs/file.c > @@ -323,7 +323,7 @@ nfs_file_fsync(struct file *file, int datasync) > have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags); > if (have_error) > ret = xchg(&ctx->error, 0); > - if (!ret) > + if (!ret && status < 0) > ret = status; > return ret; > }