Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21845065ybl; Mon, 6 Jan 2020 12:27:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwYH+Meq/ZbU3TeOm+KOllwlTUw+sBRZShZvUHFGNF8Lfd5xDncbp+V6e/cCQFOu6XYlUx+ X-Received: by 2002:a9d:6c92:: with SMTP id c18mr102800045otr.157.1578342468639; Mon, 06 Jan 2020 12:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578342468; cv=none; d=google.com; s=arc-20160816; b=0G2BQdiWU8eRoXsYfai6AM5JuO/QCaWtqaVMWs7YZi4MLYZ4zkMFZqhPF2gjtA8EHO h0nmNjjbXC4uASE6KKc1Ij0pYzTbjvc62ZffLW/nCHi4oXWaTjpG9yO+u8HGZoJTmNdz 286jz9HgCdQ2eqZ87X7oEB+BMMFmaHKR7RYfgsdOmu+Qe6Og2/YgiRLysCJxnPYNm37s vWKyLRoHm2OBxNRHXMB5Manad14XRIT33sUuyiinYbYH6E7rZzdZTGXDH1d/YK7+c9bZ fpNa8K4poAet/gaQ3bnr85sKlfc1PoTwwIuHV+QpQ3jBVv2aq5mGRlYnebHo0DGyM4j1 rf+A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mQqren3SabSmNoA5QVuXoLb4xDGESav0uq95Aq1SI5Y=; b=BWH7KfSQzyqRa0nnJbCwShsWSt+AJIpOzPwH/u393T6g0IZx7gDOuwpkn7vNNnHEvP Sd/5LHSEbuIKt/aF6McLUYQ3oxzrWLBWZYYiNaf2A1orvXoOrdgqWL595+XU6hxeFbq+ 64Ty/TxWfD/R0W8Jj1h/Hhgx6/Lzuxxo7kGqScmsepdO/YXS3uFlq7r67m2tD3umFh3B luvzgHlVvd5BNqY3Sra0B6PK5+EHHjxXPVjNkXbFk0z9kmQvouGQZCqnsfHRATpvtgrF 00qTeZNUtTVItF1QvsNR019vut8bOZjQ+Q/QaWuVyIIPtxIJkqcrRJ2v1FPU2JBsVh7F KHLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r9GEmoT7; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si28799169oto.129.2020.01.06.12.27.30; Mon, 06 Jan 2020 12:27:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=@gmail.com header.s=20161025 header.b=r9GEmoT7; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgAFU13 (ORCPT + 99 others); Mon, 6 Jan 2020 15:27:29 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:42433 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgAFU12 (ORCPT ); Mon, 6 Jan 2020 15:27:28 -0500 Received: by mail-yb1-f193.google.com with SMTP id z10so15278949ybr.9 for ; Mon, 06 Jan 2020 12:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mQqren3SabSmNoA5QVuXoLb4xDGESav0uq95Aq1SI5Y=; b=r9GEmoT7tgUwMjzx/w8elfinDcUY3SUpd09+xR80lql6t8xXFo95a/2xOpZjIQ7+Bm N8wuibZRjNBi/8oCHadlKQkNjb+cjUnisMaIKzgVXp9PE1Mfrns8s6vjlqJ8ZjnMQWjt swfJCvxObdfKfv3zz0f3vRBMyrRP0HBxfEZzNupnu+aiVewGTRZD0+mllJjmO1h/NOJX KqPGlwEpodVOpx3KE5yPTMXR4I6cVw6EDBExnAZ7i8k9UVi4ivgEVALV8zJ9DG06xPB4 BOikBqfuYj0He60Mk6Tbv6vQzkuvjKAr2Z4SY5AsBOOPYbtb8D/16VvSEjobebs/yWrP 4bVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mQqren3SabSmNoA5QVuXoLb4xDGESav0uq95Aq1SI5Y=; b=omJUBxCf13hqWCV2pmq1sgZLm68eL76bEHMJbeyYFZTISeO8Lc9BW+hGKFVg3QPE14 ep6pcXFazYQXli1uv1ooAmKtvcRfrPnUSwJDbvgtXi80IKIiUPfzvlkV9qR5R/DNZpyT LD332gW458dcnMbP+eIXOs4iSRhCB0ForvyVKzY2DxFtce1jPVBSR6xDdRTrZ5LYVO2Q PY0CCLLki67zXWoPmTIvNQhIuBteUfAuVl6p6jMzA+9xsi5EKivDpnrl8meTuKO96dnp HkPiDlm0GexIiZ33lHvlXF+tANALsYMkwhUismiTQlWvdCiSgWefHhOPKpzT9hM3SqLt G4hA== X-Gm-Message-State: APjAAAUPxr/IX+MKe7cIEIwflErjFesNqofoWm8iTvLhXyZGlOD9x8hE Wi5owE5i/JtNN/MqgyPd8Q== X-Received: by 2002:a25:447:: with SMTP id 68mr70281713ybe.432.1578342447766; Mon, 06 Jan 2020 12:27:27 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id l200sm28723579ywl.106.2020.01.06.12.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 12:27:27 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 02/15] NFS: Revalidate the file mapping on all fatal writeback errors Date: Mon, 6 Jan 2020 15:25:01 -0500 Message-Id: <20200106202514.785483-3-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106202514.785483-2-trond.myklebust@hammerspace.com> References: <20200106202514.785483-1-trond.myklebust@hammerspace.com> <20200106202514.785483-2-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If a write or commit failed, and the mapping sees a fatal error, we need to revalidate the contents of that mapping. Fixes: 06c9fdf3b9f1 ("NFS: On fatal writeback errors, we need to call nfs_inode_remove_request()") Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index f5170bc839aa..83e6f691368c 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -256,8 +256,11 @@ static void nfs_set_pageerror(struct address_space *mapping) static void nfs_mapping_set_error(struct page *page, int error) { + struct address_space *mapping = page_file_mapping(page); + SetPageError(page); - mapping_set_error(page_file_mapping(page), error); + mapping_set_error(mapping, error); + nfs_set_pageerror(mapping); } /* @@ -600,7 +603,6 @@ nfs_lock_and_join_requests(struct page *page) 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); @@ -1006,7 +1008,6 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) nfs_list_remove_request(req); if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && (hdr->good_bytes < bytes)) { - nfs_set_pageerror(page_file_mapping(req->wb_page)); nfs_mapping_set_error(req->wb_page, hdr->error); goto remove_req; } -- 2.24.1