From patchwork Fri Aug 8 15:00:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 4696701 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42938C0338 for ; Fri, 8 Aug 2014 15:01:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6CC02018E for ; Fri, 8 Aug 2014 15:01:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3FD720179 for ; Fri, 8 Aug 2014 15:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756187AbaHHPBN (ORCPT ); Fri, 8 Aug 2014 11:01:13 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:33747 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbaHHPBM (ORCPT ); Fri, 8 Aug 2014 11:01:12 -0400 Received: by mail-ie0-f177.google.com with SMTP id at20so6508187iec.36 for ; Fri, 08 Aug 2014 08:01:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BlSr9xq5L7xdnFPFOf9a9E3gerQ8n2EqZ1UGECEzWrk=; b=H/pm31K7m1XYvSSnKdF9r8WbKh2MzsDISAjljj5sIKQ0sKS771dIkursFVWtSGpOFh OEQs0RWWB8OvOqd/ieg2obKZHt4MlPUBNgVFY/6xAdR4UkkeSZdSkNSoOZkN1Er48o+j kiPbRQ/y4DhxRtl9T5ysjJK96xu27ml2s0/nyXbSZzFYC8Azg3wwd2iGlZI4KQATEqeC NJQ3HzlRK6jhqsx1so9hR31ECm6/lV3B//pMJfEXeF6pHaCU5VJZsqPruKFuTpXtKWqX VryDPvZiTf8vgayVh3dFS8ZDtrZWVRvGHgojNXSyd5PfWEn9U8ZTPbSLNAVSXWmvg0qo KuvQ== X-Gm-Message-State: ALoCoQlM3J4eeKSC+m0AZiPnsYNw/mvzG7ZrwmR5in4VOTQbq57Rpfe2G7cm9LFhGvXhLq2XayeC X-Received: by 10.42.189.73 with SMTP id dd9mr4029213icb.84.1407510071371; Fri, 08 Aug 2014 08:01:11 -0700 (PDT) Received: from gavrio-wifi.robotsandstuff.fake (c-98-209-19-144.hsd1.mi.comcast.net. [98.209.19.144]) by mx.google.com with ESMTPSA id ro8sm9930523igb.15.2014.08.08.08.01.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 08:01:11 -0700 (PDT) From: Weston Andros Adamson To: trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson Subject: [PATCH 3/5] nfs: use blocking page_group_lock in add_request Date: Fri, 8 Aug 2014 11:00:55 -0400 Message-Id: <1407510057-6881-4-git-send-email-dros@primarydata.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) In-Reply-To: <1407510057-6881-1-git-send-email-dros@primarydata.com> References: <1407510057-6881-1-git-send-email-dros@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __nfs_pageio_add_request was calling nfs_page_group_lock nonblocking, but this can return -EAGAIN which would end up passing -EIO to the application. There is no reason not to block in this path, so change the two calls to do so. Also, there is no need to check the return value of nfs_page_group_lock when nonblock=false, so remove the error handling code. Signed-off-by: Weston Andros Adamson Reviewed-by: Peng Tao --- fs/nfs/pagelist.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index f393c72..af707e0 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -872,13 +872,8 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, struct nfs_page *subreq; unsigned int bytes_left = 0; unsigned int offset, pgbase; - int ret; - ret = nfs_page_group_lock(req, true); - if (ret < 0) { - desc->pg_error = ret; - return 0; - } + nfs_page_group_lock(req, false); subreq = req; bytes_left = subreq->wb_bytes; @@ -900,11 +895,7 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, if (desc->pg_recoalesce) return 0; /* retry add_request for this subreq */ - ret = nfs_page_group_lock(req, true); - if (ret < 0) { - desc->pg_error = ret; - return 0; - } + nfs_page_group_lock(req, false); continue; }