Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp899291ybj; Fri, 20 Sep 2019 01:41:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8B8RKMAAXJynI0L6NZv5/bh48SKZkVjKZpvRz3rKr20oP6IyYS4I0HJ+UY4q/zkkKTayk X-Received: by 2002:a50:9e65:: with SMTP id z92mr20712974ede.49.1568968900221; Fri, 20 Sep 2019 01:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568968900; cv=none; d=google.com; s=arc-20160816; b=jjlpVjd8UPakLxsQnfbWp2sLjtjM0geUXWoUklI0J0qM901SZ4+fNeQQGOmAbWTA+F sqIP8KSs2fmS1suwVq20zJRAqSlaKLV8weWxJGAbgtyT+mMmTHvs2VlnBT071E4RS9BO 3t15UHOav/PuyHocpYflLRoZaxrLUQEEqVS3uGDInqNyVcYcrvcLUs5LN97rbA0S1oWY +9/WWljSbop+tvJj+WgBQRWghM9vu7328E2W1dV1oHVWnp8eu2u42zBzlJ0+eXqUPKiM sklIlhg5aKL3+XropDdAFzlOyV6/OoDCBhtqESjnqS1N2NrqnnebllKL6LnnavnuhxmO B4IA== 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=MZNU8ig7wYhgFX/5RCaJ5e5HY50ede6/nsEZyEJA2mQ=; b=rwtktPbl1lfd9jLlvLTab5rMpnJLaX/X44fOTpn9KzJn4YnhQ5VdUw6y7pugNCbHVi S14oGciqbF66FraXYE6Qdz/y1OAxs9JO0GE6irmRUWDcQMasO2dOUweIDah2ToKUqFr2 VpxRAELtr4WVeCW9xo12wdkN6g6Q2jHMTGPCRCbbYUK23BS6mNYK4WsjFFVoPWtPZ4xJ NBPzMe7eL8oJg9UQep+vNNgkLxLjaC5swChARmt1B/1l8X997kqBUOhPcPKo9EvGFIku U3wu84SvzZ3ITVb0e2sefD3KFiq5IZraEGEG3g7q/+Mu37rRcLHHMQszt+BRzRQzDuME jsHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AkmMAbKb; 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 p43si882469edc.368.2019.09.20.01.41.17; Fri, 20 Sep 2019 01:41:40 -0700 (PDT) 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=AkmMAbKb; 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 S2393375AbfISWIO (ORCPT + 99 others); Thu, 19 Sep 2019 18:08:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:46084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393369AbfISWIM (ORCPT ); Thu, 19 Sep 2019 18:08:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 B7E06218AF; Thu, 19 Sep 2019 22:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568930892; bh=4UVjTMRfyo4/iT3zFZt/WN2rfF3f6IP/Scn344Vv84M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkmMAbKb1GMnXXEtIcQVRdZAQyGSTRI2b/XwzZb1Uyu/iHl2oAU3NV5Jycd9g6kJd 1lFa1beferAsXNUhaNBz84uY4/hHi0DBo0CVxxoZGFkGBM5KJ8WWgTdDx3fF0V5edC 2z2Z8VNRZmZyPd0JUmiA0hJEGJO3U/+I4ByW8ha0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 5.2 053/124] NFS: On fatal writeback errors, we need to call nfs_inode_remove_request() Date: Fri, 20 Sep 2019 00:02:21 +0200 Message-Id: <20190919214820.932342115@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214819.198419517@linuxfoundation.org> References: <20190919214819.198419517@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Trond Myklebust [ Upstream commit 06c9fdf3b9f1acc6e53753c99c54c39764cc979f ] If the writeback error is fatal, we need to remove the tracking structures (i.e. the nfs_page) from the inode. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism...") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/write.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 059a7c38bc4fc..bf3a3f5e1884e 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -57,6 +57,7 @@ static const struct rpc_call_ops nfs_commit_ops; static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops; static const struct nfs_commit_completion_ops nfs_commit_completion_ops; static const struct nfs_rw_ops nfs_rw_write_ops; +static void nfs_inode_remove_request(struct nfs_page *req); static void nfs_clear_request_commit(struct nfs_page *req); static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo, struct inode *inode); @@ -591,7 +592,9 @@ release_request: static void nfs_write_error(struct nfs_page *req, int error) { + nfs_set_pageerror(page_file_mapping(req->wb_page)); nfs_mapping_set_error(req->wb_page, error); + nfs_inode_remove_request(req); nfs_end_page_writeback(req); nfs_release_request(req); } -- 2.20.1