From patchwork Fri Jul 15 07:33:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tao.peng@emc.com X-Patchwork-Id: 977522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6F7lCbA032224 for ; Fri, 15 Jul 2011 07:47:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755263Ab1GOHrL (ORCPT ); Fri, 15 Jul 2011 03:47:11 -0400 Received: from mexforward.lss.emc.com ([128.222.32.20]:25686 "EHLO mexforward.lss.emc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755198Ab1GOHrL convert rfc822-to-8bit (ORCPT ); Fri, 15 Jul 2011 03:47:11 -0400 Received: from hop04-l1d11-si02.isus.emc.com (HOP04-L1D11-SI02.isus.emc.com [10.254.111.55]) by mexforward.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p6F7kR0s030099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jul 2011 03:46:27 -0400 Received: from mailhub.lss.emc.com (mailhub.lss.emc.com [10.254.221.253]) by hop04-l1d11-si02.isus.emc.com (RSA Interceptor); Fri, 15 Jul 2011 03:46:20 -0400 Received: from mxhub17.corp.emc.com (mxhub17.corp.emc.com [10.254.93.46]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p6F7Xjwk016623; Fri, 15 Jul 2011 03:33:46 -0400 Received: from mx09a.corp.emc.com ([169.254.1.241]) by mxhub17.corp.emc.com ([10.254.93.46]) with mapi; Fri, 15 Jul 2011 03:33:45 -0400 From: To: CC: Date: Fri, 15 Jul 2011 03:33:42 -0400 Subject: [PATCH] NFS: fix return value of nfs_pagein_one/nfs_flush_one Thread-Topic: [PATCH] NFS: fix return value of nfs_pagein_one/nfs_flush_one Thread-Index: AcxCwEZYmgLe7WXDSFiofg365NlGMAAAA2mw Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-EMM-MHVC: 1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 15 Jul 2011 07:47:13 +0000 (UTC) From: Peng Tao Signed-off-by: Peng Tao --- This applies to Trond's nfs-for-next branch. Should some minor typos. fs/nfs/read.c | 3 ++- fs/nfs/write.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 1472933..7cba228 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -342,12 +342,13 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, struct list_head * struct page **pages; struct nfs_read_data *data; struct list_head *head = &desc->pg_list; - int ret = -ENOMEM; + int ret = 0; data = nfs_readdata_alloc(nfs_page_array_len(desc->pg_base, desc->pg_count)); if (!data) { nfs_async_read_error(head); + ret = -ENOMEM; goto out; } diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 525fb02..9fba527 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -992,7 +992,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc, struct list_head *r struct page **pages; struct nfs_write_data *data; struct list_head *head = &desc->pg_list; - int ret; + int ret = 0; data = nfs_writedata_alloc(nfs_page_array_len(desc->pg_base, desc->pg_count));