From patchwork Wed Jul 24 01:05:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13740495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15FC1C3DA49 for ; Wed, 24 Jul 2024 01:06:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6E676B0083; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B20566B0085; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0E266B0088; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 859F76B0083 for ; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B9FCC057D for ; Wed, 24 Jul 2024 01:06:05 +0000 (UTC) X-FDA: 82372854690.09.9058E2D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 7F2E610001D for ; Wed, 24 Jul 2024 01:06:03 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QiOQ2lw3; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721783117; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=y98KBMGmUe2J2iqnZ771EKPXLObJQtefLUww85ZIvzI=; b=zbbCp3zeehl4gMnPB0zIQNn72zSL7Zw99jaKMogs69RaoJHAs3u41y4cakAcgBD7tHfoma GEcn3EsVIpAYLSBQ4coj3S/EiEcNNlx72uauy4sTfFRonbWWt2qXfCa7/4IccD1miFYaX1 QNKAWPSLg18thiPUA0hJH8Rwd1h02YU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721783117; a=rsa-sha256; cv=none; b=CHQqo3R8ifyqSv6rTe2zsxwVw+GJXCMRHMAWtZwRCV6lhK0Hnb5a8iWkJTwygLffiXrSVj CFEn2t9UImAIP78w0oY/m1NgNZsE87YWBgy4rASeYCS79LjSOyWNrLo2VFCpRSbyGIJnui gsVJIfFFYEeR7XOozl7PtCwUb7JOz6U= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QiOQ2lw3; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=y98KBMGmUe2J2iqnZ771EKPXLObJQtefLUww85ZIvzI=; b=QiOQ2lw31tG6W157GXdGaIw6xs pDfIkgyYS9dEB9cL504E+dGBIPHOVam6KHS62m4c62UOXkg4HcTYnZLcWshnenzJAEreM3HDHq6DS lN/UH1pW0LmG0zsQqURu6dFDhVfPGz80ti39GxZTNszvk2Nw4I1GQxQPYS192IYkzH/WZQZKyt4vX pqv8U0MqbEWyfeLIyl5AGtHgnnnZ+ApouJQY/5R78w8Ngq3+KZBHFfWlKmVjgSGKxaEoZzOX6b7Oq Fca/bc3x8XL4EOjIhoXn3xgWZ6RrISkhHP+YBQDlJtwGDkCunMeGV6pK2gsnN9afcOiOycLNBlrod LJTranlQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWQS2-00000007MpE-21p9; Wed, 24 Jul 2024 01:05:54 +0000 From: "Matthew Wilcox (Oracle)" To: Linus Torvalds Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/2] fs: Remove calls to set and clear the folio error flag Date: Wed, 24 Jul 2024 02:05:46 +0100 Message-ID: <20240724010550.1755992-2-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724010550.1755992-1-willy@infradead.org> References: <20240724010550.1755992-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 7F2E610001D X-Stat-Signature: mor3sho7aenfru5qocptxbt8xn6hqq98 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721783163-14209 X-HE-Meta: U2FsdGVkX1+BiezDuTUIX45fH5TTIVyAmEqZYhTdy0LyzrFLSe9Lm2jpIkG1Cet0lDdrDUuNP9K9GO+VxbrxArAHTKlgCgRQkLze7NsPMFlfBVv5ww4/U4ERnLW4EYJxWDl3L8WptRfiAgqaz947nqzOvFcABIjQiZ2rZynymC2Z75U4Zoq2tVPfBKd3BGiKIMybF/XUFeGqTGY3Dyd1oM3pyvTCa/Mt9TH12xnmyDk58Rq8LqRk72aXgxoacU+VG/ok7xzIwQtVLb2Dk21fDFUHZYHWtAozZWNIt1yLMK+EOeoY6AQLkiPNbJfW3DXW5GlzgmP76c9o6MLiX3rSiqSH5dWeM9p7IMzZ5xTF5r+ZFXzMZREAm+l0wpMkc86aVT0T+KCis3MaizJwj4n7EoMHT0JpPx3iIHKRqnhSeg6Dv0eX/1xROSC2eWQE7vHAvxbtfw1uQm/oZcX9waOcLK9oyWD85brAB+AIZvObU5TDFSYATCjbHRs6mywxTZI2Tmemkl+epeTzniFkXANPh7MPad8DEhegT/EYEVJtnCQlYRhND18XJG9KPbjuF8dUooIGYlZ0LmYDFYEWtlI0/fyPwbGQBuxyZzXOh4SNeDdpvz4jaYIQid5EoRQN/XL6HhHlvJT4iwx+CUwWs4vwVlzDJlGNE8sp8cp5TAgvRfm2t/POhUBMb9/BmxYYz3aeKheUdtQ02dJXoFy9KN5DMx/lh1D2dN5FL0Pi21Xe1XcLeTQBLdzfHHXRfeE9JB6kmxxKKSqweV2v5cAK2dhMxWoWERYq14p0VuR/Gf7QMqDc8NleRBGgzHlu5T/e+sk5XP6VN59Z5QMC1y1FljtPvRcEXMnHuu8r9/AZplZFmhA91SjwyWvwTDLED2I0MCpkV1lGwyH+uVlX9pAnuy6dPMYiC+RteJG3cUGTAwbQJeZcGTi4P2AFjXvrdqhEJ4y7H1FX7enpZA3BfuEE6ES uamhVd1C 9FDlbqcEipfqaH3Q+qwhJl95Mv2HBS87voMVe/zp8Kj0OxTuGOOEc4TFHllLCRkf5dPU0GQSV+x9lZCD1mo8lEOEWNvngKxizW13/m3Z9/WztjyRj/6gc8kcjjdf9Y26CMhEA9KzPF7RcgGkCDIXNhgVECW3sbQ7Jn/ju4GJVVPzY9bJqKxZnPp2FSWbiJuMEUp7OndhhWXb0Ld2KIuKLDsEic79pww1T6OZ3VUES9QS/Jp6gQo1EhXTdrlKAlr6PbV7n X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Nobody checks the folio error flag any more, so we can stop setting and clearing it. Also remove the documentation suggesting to not bother setting the error bit. Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/filesystems/vfs.rst | 3 +-- mm/filemap.c | 8 -------- mm/migrate.c | 2 -- mm/page_io.c | 4 +--- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index 6e903a903f8f..a6022ec59a2d 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -913,8 +913,7 @@ cache in your filesystem. The following members are defined: stop attempting I/O, it can simply return. The caller will remove the remaining pages from the address space, unlock them and decrement the page refcount. Set PageUptodate if the I/O - completes successfully. Setting PageError on any page will be - ignored; simply unlock the page if an I/O error occurs. + completes successfully. ``write_begin`` Called by the generic buffered write code to ask the filesystem diff --git a/mm/filemap.c b/mm/filemap.c index d62150418b91..c7bef2247a68 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -530,7 +530,6 @@ static void __filemap_fdatawait_range(struct address_space *mapping, struct folio *folio = fbatch.folios[i]; folio_wait_writeback(folio); - folio_clear_error(folio); } folio_batch_release(&fbatch); cond_resched(); @@ -2342,13 +2341,6 @@ static int filemap_read_folio(struct file *file, filler_t filler, unsigned long pflags; int error; - /* - * A previous I/O error may have been due to temporary failures, - * eg. multipath errors. PG_error will be set again if read_folio - * fails. - */ - folio_clear_error(folio); - /* Start the actual read. The read will unlock the page. */ if (unlikely(workingset)) psi_memstall_enter(&pflags); diff --git a/mm/migrate.c b/mm/migrate.c index e7296c0fb5d5..e4431c157bc9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -585,8 +585,6 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) { int cpupid; - if (folio_test_error(folio)) - folio_set_error(newfolio); if (folio_test_referenced(folio)) folio_set_referenced(newfolio); if (folio_test_uptodate(folio)) diff --git a/mm/page_io.c b/mm/page_io.c index ff8c99ee3af7..9d4edf8bc422 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -273,9 +273,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret) * memory for allocating transmit buffers. * Mark the page dirty and avoid * folio_rotate_reclaimable but rate-limit the - * messages but do not flag PageError like - * the normal direct-to-bio case as it could - * be temporary. + * messages. */ pr_err_ratelimited("Write error %ld on dio swapfile (%llu)\n", ret, swap_dev_pos(page_swap_entry(page)));