Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3648347ima; Mon, 4 Feb 2019 02:47:16 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib5Q+0A15aS15MnMClkq03LsU2/nGNCKDToIOEuf5ZvybwrlUb/vXraHXnWldTYb6kKvQ+f X-Received: by 2002:a63:96:: with SMTP id 144mr32968358pga.315.1549277236650; Mon, 04 Feb 2019 02:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549277236; cv=none; d=google.com; s=arc-20160816; b=q1W7svXMO62bOF6rfsMNTnQ7IoqPKyhSbYcc1lIq0spG1VAqXAa3Am1Xjq9nkeTfYf n1gzhPo9LWlyQ8RgUDB8MLRLldjHDAawg9jQfLlpOaYCWi/DHxJGqxqGnJcHcCN/a6m0 CKqX0VZbn69IPQYZzA3Va9TCn+FSlFakLWHIi9PtRI3h3BTUHhmmvKOfatkbfoyZ1b4E qUr09+ucO5xOi1b27Mo36jlf0enZXHzs/Iv2BUUdtO20ZX9z1v1c65z6I5XofYILRzAf mLODSeoP6EBpehNrtGuPWA5ev0zFbqvreyyEkci4ppMc33DvyR8AGP7USbnW2mgpXKlM g3Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TS2uR0MWUrWw390bzXdiNhvJn8JRsCD2wEOCHHZWqlY=; b=LcXaGOPTOzdN3FdX5gfky91qgJTWusOrh0DNX4cVG1JY2f8c77DoMHiSMKVTj6WZjT jp2tktR4r+VfpQ5Fe369NR95qp7vHVS9QjA7nX73oyr4T8mUUctOdARLi9PD+3nlBPPK r889S2QAshYh5CJUdbXoDsiVgUp3LfQrs3ljbIdRoqjDcXktCNcHFsyuLlcOwd7sPV/H UpuVjdm3kKxESIpxhyqaalf2yMEM6c9w67Mt/6Hse39w0lfXu4O5qTZHIpCnnh87Qux+ 4R0vFBhgBgxxoERXQ6F9kYK1yghpm/1svi/eV+gYL9Yx53/MHLgU9pRviLWaoVbIMmkH aLpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ru69MP9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o68si18075564pfo.140.2019.02.04.02.47.00; Mon, 04 Feb 2019 02:47:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ru69MP9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731336AbfBDKqF (ORCPT + 99 others); Mon, 4 Feb 2019 05:46:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:44220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731294AbfBDKqD (ORCPT ); Mon, 4 Feb 2019 05:46:03 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD7DC217F9; Mon, 4 Feb 2019 10:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549277163; bh=gdEhtMfBW0gi3VdnzUn3tQLaERgfTTCe9RTWBIG9wus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ru69MP9rIZqe8G3AknvU6ZY8ZrBxUSNegD+Uq04kWbZcTohZZcwJMnXIwXdVwBdS lkFKiUQc/uhK2fSIf+StaWRUb4HUH2raxEC21W9I89ELhlWMLG4GCQht0d++po1ZjX +ID8W91yb4UC3c/qqr4u894MvcMFb0RKjtZpZQvg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Benjamin Coddington , Anna Schumaker Subject: [PATCH 4.14 24/46] NFS: Fix up return value on fatal errors in nfs_page_async_flush() Date: Mon, 4 Feb 2019 11:36:55 +0100 Message-Id: <20190204103612.804009969@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103608.651205056@linuxfoundation.org> References: <20190204103608.651205056@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust commit 8fc75bed96bb94e23ca51bd9be4daf65c57697bf upstream. Ensure that we return the fatal error value that caused us to exit nfs_page_async_flush(). Fixes: c373fff7bd25 ("NFSv4: Don't special case "launder"") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.12+ Reviewed-by: Benjamin Coddington Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/write.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -618,11 +618,12 @@ static int nfs_page_async_flush(struct n nfs_set_page_writeback(page); WARN_ON_ONCE(test_bit(PG_CLEAN, &req->wb_flags)); - ret = 0; + ret = req->wb_context->error; /* If there is a fatal error that covers this write, just exit */ - if (nfs_error_is_fatal_on_server(req->wb_context->error)) + if (nfs_error_is_fatal_on_server(ret)) goto out_launder; + ret = 0; if (!nfs_pageio_add_request(pgio, req)) { ret = pgio->pg_error; /* @@ -632,9 +633,9 @@ static int nfs_page_async_flush(struct n nfs_context_set_write_error(req->wb_context, ret); if (nfs_error_is_fatal_on_server(ret)) goto out_launder; - } + } else + ret = -EAGAIN; nfs_redirty_request(req); - ret = -EAGAIN; } else nfs_add_stats(page_file_mapping(page)->host, NFSIOS_WRITEPAGES, 1);