From patchwork Fri May 27 15:50:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863457 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C0D4C433EF for ; Fri, 27 May 2022 15:51:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353681AbiE0PvL (ORCPT ); Fri, 27 May 2022 11:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353196AbiE0Pu4 (ORCPT ); Fri, 27 May 2022 11:50:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1728134E35 for ; Fri, 27 May 2022 08:50:54 -0700 (PDT) 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=1XtQLdO3zOMxoYZ7MTiciQTgmwPX4hfSHC2XnCRgCrU=; b=X/ZfjynB0l9ZCO9PgWj9JR/tEI KX9iyayFZddcJmbIOlrS8L4dBKI18TzPRWdWSnyamzfwA8tsLyYTe3TUQrgDj9wIwmvpR6VUQhIo8 gBr43W7SfYhmLi4pC9D1tw99Y1qO9u2r93NmNIWXN6atsvBH7x5L6A+wIfUY+4cOFLuQbk4XQr352 grt/fRP3Dm5vxU7Ac7kbQhLQVknZWJcLLMXzeqgdEEBQKmmhGvFGuWPlrmobBFS/CtDeOdcHrv1A/ u2Ccb56wnii1BS8E7LctrJYT7lbSrp1WvrFq9PTaoLuBcUDZaXBXU4RqpnSyYnrl2AOYULDielCgt KWrb5mnA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWM-A8; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 01/24] block: Remove check of PageError Date: Fri, 27 May 2022 16:50:13 +0100 Message-Id: <20220527155036.524743-2-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() sees a page with PageError set, it returns a PTR_ERR(). Checking PageError again is simply dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- block/partitions/core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 8a0ec929023b..a9a51bac42df 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -716,14 +716,10 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p) (pgoff_t)(n >> (PAGE_SHIFT - 9)), NULL); if (IS_ERR(page)) goto out; - if (PageError(page)) - goto out_put_page; p->v = page; return (unsigned char *)page_address(page) + ((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << SECTOR_SHIFT); -out_put_page: - put_page(page); out: p->v = NULL; return NULL; From patchwork Fri May 27 15:50:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863442 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 465E7C433F5 for ; Fri, 27 May 2022 15:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345868AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238323AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B188F134E11 for ; Fri, 27 May 2022 08:50:42 -0700 (PDT) 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=ZlD1f57qhy3ShckNt2ffGbjpwicKrzxeuKEcj2HaQLE=; b=J7MR+u6/CPeU1QJ0awNd2gCTAB AnARRGIoWkbN6QR3J2/xC7547fBeLMrTXQnDjTsUuZJ3FoF/pUx64CyHQ8b5ydP+Xqv/4II8sLx3+ UjwMCWgnjJeVZjS1qeHVgcjOV+IQn0/6CekxY1w6DdvgK8C05LBEyaU+MsaPy13s827NUme5mx850 PSntvqp8bh6ydbalKBDkUjvnbqKpXhTRLcgy5sVs60DIcQsbHqygLyKi5Mv97EnWmGNQhVvQmnQg8 Ip71oOQPUv5eHF5vSCHpAAjugNvTw16AxuZzKjwrkpRujX0OX1XEPu3luDMAl6rVFBp42CwuqaCkk 2Jp5ybVg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWO-Cb; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 02/24] afs: Remove check of PageError Date: Fri, 27 May 2022 16:50:14 +0100 Message-Id: <20220527155036.524743-3-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/afs/mntpt.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index bbb2c210d139..97f50e9fd9eb 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c @@ -132,12 +132,6 @@ static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt) if (IS_ERR(page)) return PTR_ERR(page); - if (PageError(page)) { - ret = afs_bad(AFS_FS_I(d_inode(mntpt)), afs_file_error_mntpt); - put_page(page); - return ret; - } - buf = kmap(page); ret = -EINVAL; if (buf[size - 1] == '.') From patchwork Fri May 27 15:50:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863465 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A0C9C433EF for ; Fri, 27 May 2022 15:51:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353705AbiE0Pvc (ORCPT ); Fri, 27 May 2022 11:51:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353712AbiE0Pva (ORCPT ); Fri, 27 May 2022 11:51:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C0C1038 for ; Fri, 27 May 2022 08:51:12 -0700 (PDT) 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=Jx21YCMfVRPPtzra5uUZP9j4fCW3PrPAxum0BhgJe/Q=; b=HUSlDZ11G9WQp367CVuD3LEo4i iR4xSq+OazPUd9RZVT/cqwsKeSKL8qg99HmawCwbLR7jc4Svq48NZRi8thVsEdpzcKNRZo1rfxFc6 emAfCyGAJ955R9nDtu0RSvbPap9XWZqAtb3KbUs36NIhvlSEgFaIhXrpTlhENx+Z1a6hdMWAx2sR7 Tg4x88kpmgNcuwVJ34ldHzIh09ZH2MKNsgmPOnEhSDvofx32+pNJH7U4fVqsWs9YbnxuIC4Viu2PT /5VD8qPbOMEPP3ZGRxTZ6EhAd+Amz87NFUhoIMz1ppzhvL/Yd7NoC8JARCJdJbW/Ko1/EEwYfxLKh Dg9AIWVQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWQ-Fa; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 03/24] freevxfs: Remove check of PageError Date: Fri, 27 May 2022 16:50:15 +0100 Message-Id: <20220527155036.524743-4-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/freevxfs/vxfs_subr.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/freevxfs/vxfs_subr.c b/fs/freevxfs/vxfs_subr.c index 6143ebab940d..041e818c4577 100644 --- a/fs/freevxfs/vxfs_subr.c +++ b/fs/freevxfs/vxfs_subr.c @@ -75,15 +75,9 @@ vxfs_get_page(struct address_space *mapping, u_long n) kmap(pp); /** if (!PageChecked(pp)) **/ /** vxfs_check_page(pp); **/ - if (PageError(pp)) - goto fail; } return (pp); - -fail: - vxfs_put_page(pp); - return ERR_PTR(-EIO); } /** From patchwork Fri May 27 15:50:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863460 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D795C433EF for ; Fri, 27 May 2022 15:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353700AbiE0PvP (ORCPT ); Fri, 27 May 2022 11:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353656AbiE0PvB (ORCPT ); Fri, 27 May 2022 11:51:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E60134E3D for ; Fri, 27 May 2022 08:51:00 -0700 (PDT) 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=Zo8tq/TxfJl7q8EhTtWvLm5Ur9WjdGrs5spowtCnbu0=; b=qcPSaSoXqtBX3E6xq92irx5JaP bPnZQYfyuQpJH5dUaAHLxgHrBf7bEaAGoJV9OgCZ5RvsINeJ4mEPBcpwg3oZ6J/V6BVm5ucCdu4H3 yEKBxmpWLfbtRDKBSXiqQ7SMRTiceSitmxvnIcNxm38GL4drrpyzmUa6VXVk6/kWnvr0QP41+GK+5 RTfPO+owL4U7hwQ8lz6x0pTpcB80iAwpxSanR5Kt++mnQKMEyZmMLhCPx5Q4jLkaxMzzy0r+VlSCm c1WRE4pXThYYcb14d+EsOIYwAGVz1USFd8CXkYheq/ok3DwifdRlz4wCxsqFx1eTvQeZ4FC22MO+E DWv8pAKQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWS-IY; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 04/24] gfs: Check PageUptodate instead of PageError Date: Fri, 27 May 2022 16:50:16 +0100 Message-Id: <20220527155036.524743-5-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This is the correct flag to test to know if the read completed successfully. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/gfs2/lops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 6ba51cbb94cf..9a9a35d68bd5 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -474,7 +474,7 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index, page = find_get_page(jd->jd_inode->i_mapping, index); wait_on_page_locked(page); - if (PageError(page)) + if (!PageUptodate(page)) *done = true; if (!*done) From patchwork Fri May 27 15:50:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863464 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC696C433F5 for ; Fri, 27 May 2022 15:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353716AbiE0Pvb (ORCPT ); Fri, 27 May 2022 11:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353707AbiE0PvQ (ORCPT ); Fri, 27 May 2022 11:51:16 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61C11030 for ; Fri, 27 May 2022 08:51:12 -0700 (PDT) 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=J6ZYsEntBqEXv9QBv404Bgc48t6nDUnBZmpt61SYzKU=; b=LiGJJ8kQ87fQsAY1OFDvu/IXG9 /p1ELYx7K+911E5NCn4ItDp8JJrDnoTO9ECbIH2Duh1Z9YUkJ6yZIEuA5dbNjxgX6Qdzx/rda66rW AGs08STh0x9LpH3Mg1EndQxzbmsG/AJPeoZ9mWumUXE7L4nBjEDbfcNH2cdVWQjPJTi5x5J08SRM5 DAaRYZx5IlbfV7I4j/wQn08l/SodtBqgIC6orOO9/l2C1BXJDz1YfEFq5GwdIgWit2Yb6uJivEBx6 h5nH07gRWAl5RfUExkLlfBEGGLErgDOhLc2rm5rOW2ytAvUgEFQrIH1/n+YHXSnfuHdhn9piTbMny qmzN0+RA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWU-Kx; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 05/24] hfs: Remove check for PageError Date: Fri, 27 May 2022 16:50:17 +0100 Message-Id: <20220527155036.524743-6-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/hfs/bnode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index c0a73a6ffb28..c83fd0e8404d 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -296,10 +296,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) page = read_mapping_page(mapping, block++, NULL); if (IS_ERR(page)) goto fail; - if (PageError(page)) { - put_page(page); - goto fail; - } node->page[i] = page; } From patchwork Fri May 27 15:50:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863463 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577DBC433FE for ; Fri, 27 May 2022 15:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353710AbiE0PvX (ORCPT ); Fri, 27 May 2022 11:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353676AbiE0PvI (ORCPT ); Fri, 27 May 2022 11:51:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B133513568B for ; Fri, 27 May 2022 08:51:03 -0700 (PDT) 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=4wMMq3g5aM81AzKOoyA+PVFh218cMXjUSmWn3svbOQM=; b=r2pTcvZX9BEVvMkSidk0tFblVG f+AA4nFpaarqlyspVcUMydPbuLIMUCtWHuk9UVuTDME0BJ44GxqwxQPXIQWsTkfY80k8bSVOLs/Qy F3n2Qd1hCSrAvDM/QvBiL2her0e+X7l/I4ybmzzOxPGH6ZIRxaQOwcpKvdjoQ1keD+LpKdLX1cZk4 RL4U5mOk4sdzWyjgR/vURpJRk8dHhZMJcyYRsl4xyGFH/pMCVtELyP6I0Tv5UotlR4MZ9JHSmrvjp 5JTcKDL6jnInPZtChUb94vqvw9hC5rykH4Fj03aDq1olr6AetuiQkL8a8eaHpRi2xGUF4uByu1N8l UhWyWCyg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWW-Mv; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 06/24] hfsplus: Remove check for PageError Date: Fri, 27 May 2022 16:50:18 +0100 Message-Id: <20220527155036.524743-7-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/hfsplus/bnode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index 177fae4e6581..a5ab00e54220 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c @@ -447,10 +447,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) page = read_mapping_page(mapping, block, NULL); if (IS_ERR(page)) goto fail; - if (PageError(page)) { - put_page(page); - goto fail; - } node->page[i] = page; } From patchwork Fri May 27 15:50:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863462 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 670EAC433EF for ; Fri, 27 May 2022 15:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353709AbiE0PvV (ORCPT ); Fri, 27 May 2022 11:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353307AbiE0PvI (ORCPT ); Fri, 27 May 2022 11:51:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1711356AB for ; Fri, 27 May 2022 08:51:06 -0700 (PDT) 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=Ggb+L4sMKnorrrtIPTNimFUmJzMqRu7Oqnlpuif96os=; b=e9KrqStoM/jiiAAHayqHw8X13L NY/Z+vZ/wdzDxP9zB2ZRSWif0GPyHqG5rQ6HYbDvlVR4+58lBVTnz0ittCd4NE6f4wW/w9auYq0zU HN7Dc2Nqt7RBJ8t0wcnBlFHyYvLTOC95tqrn/YWb6w1naLTrVrzP1x3Coz6X+/WDm8qdphjp/xLnC lug7NWiGfXwJ3JQ+dfRMshIM8hbivBzNycwKX2dv/gk0bA4+u0WgN1P+D1PaHLdClSbyr7Qe9ROMi TP/JCspmbTTkW1uC4d2ELDsxqPiegTml8/WkvTjAGQ1s5JEry2c2c0gjp4R20edfoc4Dxdx+gCTk3 VsaLK0Kw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWY-P7; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 07/24] ntfs: Remove check for PageError Date: Fri, 27 May 2022 16:50:19 +0100 Message-Id: <20220527155036.524743-8-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ntfs/file.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index e1392a9b8ceb..37224ebdcd10 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -219,11 +219,6 @@ static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size) err = PTR_ERR(page); goto init_err_out; } - if (unlikely(PageError(page))) { - put_page(page); - err = -EIO; - goto init_err_out; - } /* * Update the initialized size in the ntfs inode. This is * enough to make ntfs_writepage() work. From patchwork Fri May 27 15:50:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863461 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BFC9C433F5 for ; Fri, 27 May 2022 15:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353708AbiE0PvR (ORCPT ); Fri, 27 May 2022 11:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353680AbiE0PvK (ORCPT ); Fri, 27 May 2022 11:51:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C09A613B8C1 for ; Fri, 27 May 2022 08:51:09 -0700 (PDT) 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=XjQP/FhIMNNRCHBvtTQpbw+sDJqqK43i6MI8xDK6ue4=; b=s/SNQOmeia3GYJViS3bMI/vt9F p1fx2sT3rnf6oVTVudcF+/ZPI83MYVnblbDR7d5iALZpV5fYuEmP75M9lQZCp+7F+MjBu+MKTU8Kr KMp5kmB8yCJiyKsSUrW1OVq5qWgE+eHSsRIDmvTMtBwqL3ZCP1yJmUNZu7eies+fgLLh1r4jmxJh4 MDGzcYx1T8GVus8gV7jHg+wzVvFtDNmJgoy78NGA1sj+U4HlTpuKiUKBNH0tumD+fCW3s5Eim5ipe O6abP0bvbUG1oZ8EddBj7G0qjrRc3gqNvyGVt9swuAckGmfALxap68pRqBLMAoXy9hPGONDpxdzLX ijeunrQQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWa-RE; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 08/24] ext2: Remove check for PageError Date: Fri, 27 May 2022 16:50:20 +0100 Message-Id: <20220527155036.524743-9-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this test is not needed. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ext2/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 2c2f179b6977..3410e4132405 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -204,8 +204,7 @@ static struct page * ext2_get_page(struct inode *dir, unsigned long n, if (!IS_ERR(page)) { *page_addr = kmap_local_page(page); if (unlikely(!PageChecked(page))) { - if (PageError(page) || !ext2_check_page(page, quiet, - *page_addr)) + if (!ext2_check_page(page, quiet, *page_addr)) goto fail; } } From patchwork Fri May 27 15:50:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863455 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F15EDC433F5 for ; Fri, 27 May 2022 15:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353672AbiE0PvI (ORCPT ); Fri, 27 May 2022 11:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353091AbiE0Pur (ORCPT ); Fri, 27 May 2022 11:50:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B150D134E11 for ; Fri, 27 May 2022 08:50:45 -0700 (PDT) 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=DJY687eqHjmpDVUKm/xXxUZxBj5KWv9uItsiE/FIc4I=; b=Y8f1cRpo8fYv+eUKAfQeyS8pik SlRPrFW+ZvhpPNkvDEI8UGgqO26CquSyrXSTmdqXXYSOb5xddzl+KFizeqoDCvwdckwzWioTRFu2o BtyHp4vRjrPr6x2SlMJX1/voab0Kk3/BUT58eNr2bU3ZgoH8stycbX6EN5uAuuom0gAMaBc2nBzfB BfVOcdszN29s6pROELQxSfHGPS2tj/ngpZbfeuVSLtoRUYaqnSBcBLAR0nBAQz2cf97PXGHeryMP+ zEJIifXcjGLyD2jIFhweM0CTS539uARqFxwVEvKQaUeBOEJJL0xYP/Pjd/EwddsBUElfVOI3030Ch 6e9C4rZA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWc-Tg; Fri, 27 May 2022 15:50:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 09/24] nilfs2: Remove check for PageError Date: Fri, 27 May 2022 16:50:21 +0100 Message-Id: <20220527155036.524743-10-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this test is not needed. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/nilfs2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index f8f4c2ff52f4..decd6471300b 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c @@ -194,7 +194,7 @@ static struct page *nilfs_get_page(struct inode *dir, unsigned long n) if (!IS_ERR(page)) { kmap(page); if (unlikely(!PageChecked(page))) { - if (PageError(page) || !nilfs_check_page(page)) + if (!nilfs_check_page(page)) goto fail; } } From patchwork Fri May 27 15:50:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863456 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94E4CC4332F for ; Fri, 27 May 2022 15:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353678AbiE0PvK (ORCPT ); Fri, 27 May 2022 11:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347152AbiE0Pu4 (ORCPT ); Fri, 27 May 2022 11:50:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9863A134E29 for ; Fri, 27 May 2022 08:50:53 -0700 (PDT) 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=qQEqXPIAXhUgwxBQ6QCQQiUDHFUM6Ol8abPdc//PdiU=; b=AEvZLXAZaZa8elyEnFJg5ybISg NLks/WO1fkcraDEOC20sRV53DbHf/RH9vvAuBNrFaN9Vde28KDKOyQmaadzu4ZMkaH4ri6WmsUWOZ +R5vkEjpecbxOrtxX0qC8mIY1FQ549yEy0L4UD40sWuv6Qc6sRDr7LeuBm1scC1MVXhk0paclE9O1 iR9QC/W+b98Zy/za24PRlyDawBJrAmPxDpQUxX8f13MPSFMzmwVDu1BJV9pN/KFfdUmPy/mnKHZQm rmlqqaCKmYQxe4atKaquqgAe+nCN1+vYYUuBJlCdRmKfgs7p6KSIAYwTrsFDt9mpYaDqm8JWs8NJF KP2IGpSA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEa-002CWe-W6; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 10/24] ntfs: Remove check for PageError Date: Fri, 27 May 2022 16:50:22 +0100 Message-Id: <20220527155036.524743-11-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ntfs/aops.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/ntfs/aops.h b/fs/ntfs/aops.h index 934d5f79b9e7..0cac5458c023 100644 --- a/fs/ntfs/aops.h +++ b/fs/ntfs/aops.h @@ -74,13 +74,8 @@ static inline struct page *ntfs_map_page(struct address_space *mapping, { struct page *page = read_mapping_page(mapping, index, NULL); - if (!IS_ERR(page)) { + if (!IS_ERR(page)) kmap(page); - if (!PageError(page)) - return page; - ntfs_unmap_page(page); - return ERR_PTR(-EIO); - } return page; } From patchwork Fri May 27 15:50:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863458 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79B9AC433FE for ; Fri, 27 May 2022 15:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353685AbiE0PvM (ORCPT ); Fri, 27 May 2022 11:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348364AbiE0Pu4 (ORCPT ); Fri, 27 May 2022 11:50:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A62D4134E2C for ; Fri, 27 May 2022 08:50:53 -0700 (PDT) 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=c2PSGU+T+5Ia0BRl8u+GB44oYmq/DVLwd9sUaj+DKts=; b=Dtw+Y2W54adVVz09SgjOgFLZbE mHr9LwsCSZX8Rv4Hgp3W4bRTC7UEMlY/zEwB4EmXZpUeCjrnmofa3ZsXC+oRQhpkRQnqxz6W/YvhC fNHFp43Y/erGNEmOIbs35QRm+bHocoGboYyxWwq6FAnIq9PNmBing0Xw1m7mWx5OLWuWnZ56FuwFF 4tkdXa01YWebNMyzsQfpV4Rnkmn0Cn42tpopfJLOs3lxyCXm1qROnXbBE6wxqX/yQF7sjnQF0jeW2 aLj/yCwdh/PDEFjTOEpmdgdlN6XZMfwbfnu+RoTwxr/2F2WImuCUpt7xdTMZOl99gcalmjtVKFJtj 5MAC+wGw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CWg-2I; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 11/24] ntfs3: Remove check for PageError Date: Fri, 27 May 2022 16:50:23 +0100 Message-Id: <20220527155036.524743-12-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ntfs3/ntfs_fs.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 8de129a6419b..f28726c4e845 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -896,13 +896,8 @@ static inline struct page *ntfs_map_page(struct address_space *mapping, { struct page *page = read_mapping_page(mapping, index, NULL); - if (!IS_ERR(page)) { + if (!IS_ERR(page)) kmap(page); - if (!PageError(page)) - return page; - ntfs_unmap_page(page); - return ERR_PTR(-EIO); - } return page; } From patchwork Fri May 27 15:50:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863441 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B6B2C433FE for ; Fri, 27 May 2022 15:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352785AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242714AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3771134E17 for ; Fri, 27 May 2022 08:50:42 -0700 (PDT) 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=i2t/qLSgdmu/wJjlxbx86LZigla0S50FB+rJa/7oTp4=; b=HCcffH2/971xsM0+d7Gy9W0H/B iPootp9x8eswPq0Kv4uWn/Qk1XU1UEl63BQMinB1PphPvm9o51q8hhzdZR9QR66bHgFlSPGcT1dio yH1kBWZNcgdTkPaHJmlUO8qBPrxtlD9VlqozZdwPu0n75kzO+XJvEjZqS8MGj4tgSy1VyZt8jQPiT o+imv1RHzwTsBsxZ+VVlk7Jzf+JxP5t/RzBhBOlONxtggzLj5UzcdeLxxbJE3mlMaus6437664xgp yFAofy5Ce1vUeAUC5YoraA05b711s5O2FHcdn6NUgpj7wyoSXb9wvLerkXr/chh7l06BZy6wCPlZk eigNaKZQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CWi-4C; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 12/24] reiserfs: Remove check for PageError Date: Fri, 27 May 2022 16:50:24 +0100 Message-Id: <20220527155036.524743-13-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/reiserfs/xattr.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index bd073836e141..436641369283 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -440,16 +440,9 @@ static struct page *reiserfs_get_page(struct inode *dir, size_t n) */ mapping_set_gfp_mask(mapping, GFP_NOFS); page = read_mapping_page(mapping, n >> PAGE_SHIFT, NULL); - if (!IS_ERR(page)) { + if (!IS_ERR(page)) kmap(page); - if (PageError(page)) - goto fail; - } return page; - -fail: - reiserfs_put_page(page); - return ERR_PTR(-EIO); } static inline __u32 xattr_hash(const char *msg, int len) From patchwork Fri May 27 15:50:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863444 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47200C4332F for ; Fri, 27 May 2022 15:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353096AbiE0Put (ORCPT ); Fri, 27 May 2022 11:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348214AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2745134E1B for ; Fri, 27 May 2022 08:50:42 -0700 (PDT) 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=/scZq8fB5tdsLNMW65ChH7dPhcyWv6zstS+3cc3hsxY=; b=urDGnyxvX8yXiBntCrqDbG+kik bTATo/TsnGYgW+eT8sVwSjzWII/uwrfzwA77CQNR3VViFlgQgj9sNn4ubHmW26v5gIdnqy6H29/cU dNEYvGhmuOpddHVSMPnldrTT5ATdBJWJhzNTcQuTzhxzU0t2KSCT8VRNmoFG/41icFy7vrsCN6ZSM oxjGflq+96BlbzU5J/SuBTPCJhalvYx4qWDtg8Kv7yiU25eCYY1znpVZmCqvTSLK1HGOPL23m+zMD wynkpG0i2m9kgPlRP6t/lWmgrMWhWctsuMetu/rKkLjXLlB06ocSrIMdsqMnO2UrvEwQJDZx8p7g6 oCem3qDw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CWu-7e; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 13/24] ufs: Remove checks for PageError Date: Fri, 27 May 2022 16:50:25 +0100 Message-Id: <20220527155036.524743-14-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, or a page that is not Uptodate, so this is dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ufs/dir.c | 2 +- fs/ufs/util.c | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index b721d0bda5e5..391efaf1d528 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c @@ -193,7 +193,7 @@ static struct page *ufs_get_page(struct inode *dir, unsigned long n) if (!IS_ERR(page)) { kmap(page); if (unlikely(!PageChecked(page))) { - if (PageError(page) || !ufs_check_page(page)) + if (!ufs_check_page(page)) goto fail; } } diff --git a/fs/ufs/util.c b/fs/ufs/util.c index 4fa633f84274..08ddf41eaaad 100644 --- a/fs/ufs/util.c +++ b/fs/ufs/util.c @@ -264,17 +264,6 @@ struct page *ufs_get_locked_page(struct address_space *mapping, put_page(page); return NULL; } - - if (!PageUptodate(page) || PageError(page)) { - unlock_page(page); - put_page(page); - - printk(KERN_ERR "ufs_change_blocknr: " - "can not read page: ino %lu, index: %lu\n", - inode->i_ino, index); - - return ERR_PTR(-EIO); - } } if (!page_has_buffers(page)) create_empty_buffers(page, 1 << inode->i_blkbits, 0); From patchwork Fri May 27 15:50:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863443 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80CE8C433EF for ; Fri, 27 May 2022 15:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353087AbiE0Puq (ORCPT ); Fri, 27 May 2022 11:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346627AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C1A134E1C for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=gjB7ffm4OT663eqxVe5L5iGJXsteQdmweyBBvgi2xdk=; b=kW4L8s63H6FeU0oDydp2sGJXlW OguZ3jTDRVe0fIiI+IjLSFregSWXlFrZqq3DM0lj3yV+oiMIuht5osEzWyB/eg0DGN6NHnSZiOgLg qtUpcJXwbShAqNOpibv8pPlnDt3ObhUKWVEFtVOT+P4PolnjeNCIB1OohxA1LuSznDSTojF5SE7BO PV9qG95xIivcso6ERu8n3RmLAIiHLdsoScf+44i6Doe200HF4Kq6e4UCGN2B238AkpGXdPM07R/mB mACIEOoWe7v/9OmfWs9u+EXwMrxwbFdNNzPm8oXPcRPQy2jQ8FcaL2zNCkHDb1SWVhUCQdMx+XkFV CgcK07jw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CX3-BZ; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 14/24] remap_range: Remove check of uptodate flag Date: Fri, 27 May 2022 16:50:26 +0100 Message-Id: <20220527155036.524743-15-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org read_mapping_folio() returns an ERR_PTR if the folio is not uptodate, so this check is simply dead code. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/remap_range.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/remap_range.c b/fs/remap_range.c index e112b5424cdb..f1a3795812ce 100644 --- a/fs/remap_range.c +++ b/fs/remap_range.c @@ -148,16 +148,7 @@ static int generic_remap_check_len(struct inode *inode_in, /* Read a page's worth of file data into the page cache. */ static struct folio *vfs_dedupe_get_folio(struct file *file, loff_t pos) { - struct folio *folio; - - folio = read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file); - if (IS_ERR(folio)) - return folio; - if (!folio_test_uptodate(folio)) { - folio_put(folio); - return ERR_PTR(-EIO); - } - return folio; + return read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file); } /* From patchwork Fri May 27 15:50:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863446 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3D3DC4332F for ; Fri, 27 May 2022 15:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353164AbiE0Puv (ORCPT ); Fri, 27 May 2022 11:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348364AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B6A134E1E for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=l7LNbIHxxAJWnDwEjKP+/zdoMebmfgf3sLh/x6oLt/Q=; b=QBmsEGOts8OK8XgPyzg9AOG3DP 9o97tFXEQG/9M5guQrlWtwgBC8L+MA/Vdu8S1BJFcUpdKKimazSkqbX5YU6nkUVMMGRICMxLjEOjQ PgwCHAZTmGUEdtK02zmUV6Vxn2gMC7vDb3vjmzQLHuuT4YpdhC7zOAnqQ6CWxVsXrhA0aMc/ehB9m jzHhCB1K4+hwuTNkHbZIUUZNjcYQ78fIklzdz0PExpg9JHpfz0sriucHGoaBEirbs3qykhf7BwkUR giLmsGgFkF8Ns66igJzjyqgSnRkn/+VUrumOeM8zDN5LuP2s9KBkfM92fDYiYaxyfebln4jC4dKzt a/0nYhOQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CX9-F7; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 15/24] jfs: Remove check for PageUptodate Date: Fri, 27 May 2022 16:50:27 +0100 Message-Id: <20220527155036.524743-16-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Pages returned from read_mapping_page() are always uptodate, so this check is unnecessary. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/jfs/jfs_metapage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 387652ae14c2..2e8461ce74de 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -618,7 +618,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, SetPageUptodate(page); } else { page = read_mapping_page(mapping, page_index, NULL); - if (IS_ERR(page) || !PageUptodate(page)) { + if (IS_ERR(page)) { jfs_err("read_mapping_page failed!"); return NULL; } From patchwork Fri May 27 15:50:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863445 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1140C433FE for ; Fri, 27 May 2022 15:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353133AbiE0Puu (ORCPT ); Fri, 27 May 2022 11:50:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351474AbiE0Puo (ORCPT ); Fri, 27 May 2022 11:50:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BD6134E1F for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=qRH6hDYB4+yS9n8y2k8u+XGjqusFj7Bxpzd2Aqkf8kE=; b=OcJ5vYOVl6ojRj59rrC2Ue9m6I 9sLen2ehKuPsVe94n6+VTYycTZwxWbgiKQ/JzozbK3rMiUO/IkG0OPLn3aO3Ej5pzcHNkDvRXPVkY bRe94WphLj9tH54EdYD9cik0HwuVncYM6GXSpWciSBxxO9M1UJSOmK7ya6drkJ6cfyVelKMCVII01 WaKNnvn301v9FOVgBErswLFHGfiC9VUBLbQVDoYQ6sgPcaaWYQk8vyICRTb/eeCa0AViNw/KINJgV YBIQxETfusC2xNlYvNfp9HnmRHQro7VE6b8iru92v5Eh23tTf8FSA9dm1lSDm2yQ4vSC0E66tOiab olcH/EJQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CXF-It; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 16/24] iomap: Remove test for folio error Date: Fri, 27 May 2022 16:50:28 +0100 Message-Id: <20220527155036.524743-17-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Just because there has been a read error doesn't mean we should avoid marking this part of the folio as uptodate. Indeed, it may overwrite the error part of the folio and let us mark the entire folio uptodate. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index d2a9f699e17e..66278a14bfa7 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -154,9 +154,6 @@ static void iomap_iop_set_range_uptodate(struct folio *folio, static void iomap_set_range_uptodate(struct folio *folio, struct iomap_page *iop, size_t off, size_t len) { - if (folio_test_error(folio)) - return; - if (iop) iomap_iop_set_range_uptodate(folio, iop, off, len); else From patchwork Fri May 27 15:50:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863450 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BDE7C433F5 for ; Fri, 27 May 2022 15:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232620AbiE0PvC (ORCPT ); Fri, 27 May 2022 11:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352746AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EB70134E22 for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=gf5p2e+qdxhVcf8PVIs5vyx8mN40hpMkTkem7ExcQzs=; b=lhiGc57FtMXrLSprJ/6hdRf3UW /QO1rjDpI/C4ozMk+kJ5STb81l/0bkIhTZQcA61j2aKYjcRwzk/5YJiTsco8qhqfespCd9Ir8UuC3 yfkvBGaoPMqbRD66WRMs0rBh12+Ed9qtiLYnW48tZQJaGV8Zd0Ia7TqA64I0hkR9ys4B9YuBvOYLf Wne+gRuJY61q/a1JjdEq/9h4JmjPrFe8pW53fgwzFSEYnyvBZGbBo0p9kyLLiT2cRhdV+8vr3uUcf cnjF3BEbq1XdY5Vv96wUcsW9LTnSmEWeekBg8qZdHoOllnZ1FNj8CKua5Jjf/G8H7Ml6E82icQiEc d+H4PLjQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CXL-Mx; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 17/24] orangefs: Remove test for folio error Date: Fri, 27 May 2022 16:50:29 +0100 Message-Id: <20220527155036.524743-18-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The page cache clears the error bit before calling ->read_folio(), so this condition could never have been true. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/orangefs/inode.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 5ce27dde3c79..7a8c0c6e698d 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -307,7 +307,7 @@ static int orangefs_read_folio(struct file *file, struct folio *folio) ret = wait_for_direct_io(ORANGEFS_IO_READ, inode, &off, &iter, folio_size(folio), inode->i_size, NULL, NULL, file); - /* this will only zero remaining unread portions of the page data */ + /* this will only zero remaining unread portions of the folio data */ iov_iter_zero(~0U, &iter); /* takes care of potential aliasing */ flush_dcache_folio(folio); @@ -315,8 +315,6 @@ static int orangefs_read_folio(struct file *file, struct folio *folio) folio_set_error(folio); } else { folio_mark_uptodate(folio); - if (folio_test_error(folio)) - folio_clear_error(folio); ret = 0; } /* unlock the folio after the ->read_folio() routine completes */ From patchwork Fri May 27 15:50:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863449 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14DAAC43217 for ; Fri, 27 May 2022 15:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352173AbiE0PvA (ORCPT ); Fri, 27 May 2022 11:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351976AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7532A134E29 for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=tCiC/LNfeYVDL+hpPkwMSf65SMCxXRoZcgr2jCxRYnI=; b=T5uqWMX/dp9SRQ8FhdUZqQnkhX 6xnjbD0GqE9Qx4q8o6rCGdxsr9Im0SFwCMgqR39gkk8jgDFF7t/hEBrzaNI4i2cT8GONwXkEwS9MD yqDrVd4htYqstbiquy+//WpUQgObnWFDDOLAWtCqA1Rcw0WISWYhO/5Fdm14eMr9B+Hdv5hCSJDOY BBEXkWlvb4lepoh+Kqc500dozdqxWcnlkGdfdjQng4ndCP07gzIVvE9FBoxVjsBY4uApMw4e0ToUS 2uLbNig6eQ/7JP1gMwsqO4PDaI/YwF5hFBH1rppCuqB9v15ej1aDmm4Js4lIHvWoWrdOr4FnSIoxq VSKqJ0Fw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CXR-QV; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 18/24] buffer: Remove check for PageError Date: Fri, 27 May 2022 16:50:30 +0100 Message-Id: <20220527155036.524743-19-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If a buffer is completed with an error, its uptodate flag will be clear, so the page_uptodate variable will have been set to 0. There's no need to check PageError here. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 898c7f301b1b..c37a9c3bfb2f 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -282,10 +282,10 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) spin_unlock_irqrestore(&first->b_uptodate_lock, flags); /* - * If none of the buffers had errors and they are all - * uptodate then we can set the page uptodate. + * If all of the buffers are uptodate then we can set the page + * uptodate. */ - if (page_uptodate && !PageError(page)) + if (page_uptodate) SetPageUptodate(page); unlock_page(page); return; From patchwork Fri May 27 15:50:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863448 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F483C433F5 for ; Fri, 27 May 2022 15:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240115AbiE0Pu7 (ORCPT ); Fri, 27 May 2022 11:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352173AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B294F134E2C for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=9lB4vg82X1aog+28GWsmbeVPWSeO4zm3Yw9Wz/19ZOE=; b=ag3i1XA7jzfjKuUZ8shp/7sg1h wLQ6vjDq9I+L9K7YxSACq06x6pSP2JXcl9ZdntwywcPK7HZFThj8mZLNwg06Y4b2OPyQUfV9P6pIB aKN/jkdId0/BHiqh05UlkNtdUiQYLN+OU7oSh7Qqy6jJCu4FEFWwOzC5gmmeoiPWclnweev/6LrTc CA64sccsLFtaWGq0C8Z32MBa322W4YmNIxDqNlBX0Hbx6f0RIArhxhHloKwxQiEJ+PUzzwCCmu3Y6 HbDJ+PRTQPETKaD+YZ0WzgTgZC7pGpKoBHJPVkSeR+CL3ut6C/+ISoMMo2GAD2PyhZ8bVOUL712jO KOhxNxxw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEb-002CXX-U1; Fri, 27 May 2022 15:50:41 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 19/24] nfs: Leave pages in the pagecache if readpage failed Date: Fri, 27 May 2022 16:50:31 +0100 Message-Id: <20220527155036.524743-20-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The pagecache handles readpage failing by itself; it doesn't want filesystems to remove pages from under it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/nfs/read.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 5a9b043662e9..8ae2c8d1219d 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -120,12 +120,8 @@ static void nfs_readpage_release(struct nfs_page *req, int error) if (nfs_error_is_fatal_on_server(error) && error != -ETIMEDOUT) SetPageError(page); if (nfs_page_group_sync_on_bit(req, PG_UNLOCKPAGE)) { - struct address_space *mapping = page_file_mapping(page); - if (PageUptodate(page)) nfs_fscache_write_page(inode, page); - else if (!PageError(page) && !PagePrivate(page)) - generic_error_remove_page(mapping, page); unlock_page(page); } nfs_release_request(req); From patchwork Fri May 27 15:50:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863447 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B29D2C4332F for ; Fri, 27 May 2022 15:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353518AbiE0Pu6 (ORCPT ); Fri, 27 May 2022 11:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352555AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA753134E31 for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=dfGfqAk8u2UgYRm1HwJBzRxe+frhR8Bp+J7CKaOOiwY=; b=BSvw+oaTsBzBEeznCI3GEV7N2c dA2VISpqFvg+bo01gFuZ5w/O1Tb9fmB7VmatFZz+pmkSnR6/S5OuId7wNAnip6CGq2N64kYuD94fb a3LHNBu3LMenov6oLxVOQC+Ed+1uMA1GVcvLq24vpoQUg21vavOgpBuuzEQdTHI2CkuyWeR8mnpWM 5DJG5vx+KFxTvXoTGAMUjeQeKh7fAAcDPWp/q5m1DTc1kFlufw4Vwz08ziebA/0tY6neIUTcf5h75 RUO7AJVTCXddsO8XOmK1f6vtkwWjP9O0gizv1fdb4TH/i0wRigme2cvYIheoeYhR/yyLtVioC4HQv ymDB3llw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEc-002CXd-1H; Fri, 27 May 2022 15:50:42 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 20/24] btrfs: Use a folio in wait_dev_supers() Date: Fri, 27 May 2022 16:50:32 +0100 Message-Id: <20220527155036.524743-21-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Remove a use of PageError and optimise putting the page reference twice. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/btrfs/disk-io.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 89e94ea2fef5..12b11e645c14 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4178,7 +4178,7 @@ static int wait_dev_supers(struct btrfs_device *device, int max_mirrors) max_mirrors = BTRFS_SUPER_MIRROR_MAX; for (i = 0; i < max_mirrors; i++) { - struct page *page; + struct folio *folio; ret = btrfs_sb_log_location(device, i, READ, &bytenr); if (ret == -ENOENT) { @@ -4193,27 +4193,24 @@ static int wait_dev_supers(struct btrfs_device *device, int max_mirrors) device->commit_total_bytes) break; - page = find_get_page(device->bdev->bd_inode->i_mapping, + folio = filemap_get_folio(device->bdev->bd_inode->i_mapping, bytenr >> PAGE_SHIFT); - if (!page) { + if (!folio) { errors++; if (i == 0) primary_failed = true; continue; } - /* Page is submitted locked and unlocked once the IO completes */ - wait_on_page_locked(page); - if (PageError(page)) { + /* Folio is unlocked once the IO completes */ + folio_wait_locked(folio); + if (!folio_test_uptodate(folio)) { errors++; if (i == 0) primary_failed = true; } - /* Drop our reference */ - put_page(page); - - /* Drop the reference from the writing run */ - put_page(page); + /* Drop our reference and the one from the writing run */ + folio_put_refs(folio, 2); } /* log error, force error return */ From patchwork Fri May 27 15:50:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863454 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B266FC4332F for ; Fri, 27 May 2022 15:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353668AbiE0PvG (ORCPT ); Fri, 27 May 2022 11:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352485AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9A29134E35 for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=8Xen5gC1HhkspCEo+ZyScnM78AzlIPquQEw05FXhHuQ=; b=pr2MHsNtJ4o0Up/SM7gZj552Qv MBlnsEH1oadbJ1tbDIue/HxbW1HHv8JdfkD4Uc8hmg4N53qWtF5nr6X3EAuYAWUCJqRm7XBsnje1o peatyEetm9/zjQ01/TSaHvAlWkRNfh5RC7eo1AN/U6Lp17Kjv5UkRur80bK1klQlB+URXYGi/L+R+ MEhYRygopP0fZLDL/UjRf3ROTu2Tropvugs4i3wgMOm9t/AZZhHDoE2cAqLRPdQSvczr5q36lNJ2F PDK2sx7jK5Xbi2IOi/NKhFQ9hd2YK1uWIZgiw4/gIV4OaIMVuN7Gw0CjTlbgIn8C1VuvwgetDAeLC MgQk7TUw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEc-002CXj-4F; Fri, 27 May 2022 15:50:42 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 21/24] buffer: Don't test folio error in block_read_full_folio() Date: Fri, 27 May 2022 16:50:33 +0100 Message-Id: <20220527155036.524743-22-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org We can cache this information in a local variable instead of communicating from one part of the function to another via folio flags. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index c37a9c3bfb2f..5a4609b8b2b4 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2259,6 +2259,7 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block) unsigned int blocksize, bbits; int nr, i; int fully_mapped = 1; + bool page_error = false; VM_BUG_ON_FOLIO(folio_test_large(folio), folio); @@ -2283,8 +2284,10 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block) if (iblock < lblock) { WARN_ON(bh->b_size != blocksize); err = get_block(inode, iblock, bh, 0); - if (err) + if (err) { folio_set_error(folio); + page_error = true; + } } if (!buffer_mapped(bh)) { folio_zero_range(folio, i * blocksize, @@ -2311,7 +2314,7 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block) * All buffers are uptodate - we can set the folio uptodate * as well. But not if get_block() returned an error. */ - if (!folio_test_error(folio)) + if (!page_error) folio_mark_uptodate(folio); folio_unlock(folio); return 0; From patchwork Fri May 27 15:50:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863453 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04909C433F5 for ; Fri, 27 May 2022 15:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353663AbiE0PvG (ORCPT ); Fri, 27 May 2022 11:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242714AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B8E5134E38 for ; Fri, 27 May 2022 08:50:43 -0700 (PDT) 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=KV0SikI/SB3SrY5NZJBM8ckFOFL47m5xu8gYB9A0uRI=; b=Ryhf9qgRsU18ms7Z3Y2KaPP/G0 EzjTVlWi2W75I0bkOTZNUBNa3pbGQct+dYX8WETHXDYk7Oc5LeprpWHA1yA6daibjFLKR2wVhyXpF /KsZNtHVqm2R6VbQ/Q1N4xSy5J1PXra7/X6RSB0ycQ1jh3mR80zYGLqQVV7XkbOzjmG2dyi1Xa5qZ UryhUbsXuXaUjzp90azxszyW0PJOvt5TiTLygclohU3cPBRaamav6Qe/5+2+NZah+mg8wMkJA5OpP 9M0CPXaK7BiCI+Pg3FA9wgy7KcG1gJOo8K6pO/Wu8WN17RIGEKT74/+S9RPZSWVnmKhpHkdhll90O kUHDAnVA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEc-002CXp-6h; Fri, 27 May 2022 15:50:42 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 22/24] squashfs: Return the actual error from squashfs_read_folio() Date: Fri, 27 May 2022 16:50:34 +0100 Message-Id: <20220527155036.524743-23-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Since we actually know what error happened, we can report it instead of having the generic code return -EIO for pages that were unlocked without being marked uptodate. Also remove a test of PageError since we have the return value at this point. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/squashfs/file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index a8e495d8eb86..7f0904b20329 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -454,7 +454,7 @@ static int squashfs_read_folio(struct file *file, struct folio *folio) int expected = index == file_end ? (i_size_read(inode) & (msblk->block_size - 1)) : msblk->block_size; - int res; + int res = 0; void *pageaddr; TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", @@ -467,14 +467,15 @@ static int squashfs_read_folio(struct file *file, struct folio *folio) if (index < file_end || squashfs_i(inode)->fragment_block == SQUASHFS_INVALID_BLK) { u64 block = 0; - int bsize = read_blocklist(inode, index, &block); - if (bsize < 0) + + res = read_blocklist(inode, index, &block); + if (res < 0) goto error_out; - if (bsize == 0) + if (res == 0) res = squashfs_readpage_sparse(page, expected); else - res = squashfs_readpage_block(page, block, bsize, expected); + res = squashfs_readpage_block(page, block, res, expected); } else res = squashfs_readpage_fragment(page, expected); @@ -488,11 +489,11 @@ static int squashfs_read_folio(struct file *file, struct folio *folio) memset(pageaddr, 0, PAGE_SIZE); kunmap_atomic(pageaddr); flush_dcache_page(page); - if (!PageError(page)) + if (res == 0) SetPageUptodate(page); unlock_page(page); - return 0; + return res; } From patchwork Fri May 27 15:50:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863451 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0480DC4332F for ; Fri, 27 May 2022 15:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353661AbiE0PvE (ORCPT ); Fri, 27 May 2022 11:51:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352820AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE5B134E3A for ; Fri, 27 May 2022 08:50:44 -0700 (PDT) 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=e0XmxPlauxAq5iJGHvK9f2GU7KuIll9jS6x2f9sMeng=; b=MDKaxVqoC1OyUk+eWBfs18A3xL /9ii/C2wDZ1MNkbvtp3MfXFVQZpxbNKOk/fXOHeD+5Wbz1MlcyROvN1eeiOXPVBsiV/0uYGWo7OvR zyn1d5CiojeJ2aoAVNY518jko8t5QPOhU5C1qucKwX4JnS8eTAnuJmxtGgJ8/X4GH1ZKhipDSufhy EfFsr4DSLISbxACgLYVXcuftx2npvYtJQrUdOu+zOxXFPUGqJe8w6pj2yo09bImNqp+8BcotBAhs4 0Q7E9OZ6rtFeVveDja5DgkKJSzPN65wNbiNTIF6JfbKgUGvqFjNub1bm8mHtYJJSt2VXsRgDIdVap wLq/lkqQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEc-002CXv-AF; Fri, 27 May 2022 15:50:42 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 23/24] hostfs: Handle page write errors correctly Date: Fri, 27 May 2022 16:50:35 +0100 Message-Id: <20220527155036.524743-24-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If a page can't be written back, we need to call mapping_set_error(), not clear the page's Uptodate flag. Also remove the clearing of PageError on success; that flag is used for read errors, not write errors. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/hostfs/hostfs_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index cc1bc6f93a01..07881b76d42f 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -416,15 +416,15 @@ static int hostfs_writepage(struct page *page, struct writeback_control *wbc) err = write_file(HOSTFS_I(inode)->fd, &base, buffer, count); if (err != count) { - ClearPageUptodate(page); + if (err >= 0) + err = -EIO; + mapping_set_error(mapping, err); goto out; } if (base > inode->i_size) inode->i_size = base; - if (PageError(page)) - ClearPageError(page); err = 0; out: From patchwork Fri May 27 15:50:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12863452 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF44C43217 for ; Fri, 27 May 2022 15:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353662AbiE0PvE (ORCPT ); Fri, 27 May 2022 11:51:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352896AbiE0Pup (ORCPT ); Fri, 27 May 2022 11:50:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FF0E134E3C for ; Fri, 27 May 2022 08:50:44 -0700 (PDT) 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=Wmftxi7ZyMXSgnSMBA2RNVuZQulAw5FzEFja1eTaYAM=; b=h63Z8iUYz6GggwqH7hdkxq8mei 81DME2H8ys3v+gQSj+HkgDycIWcgV9raLaLBvT/gB1LcURKhHmNkWtAjYyBVFFxtJdIVi0t1uXr8m SIrdTZyXrQc9E9QcWCeJRR0TKvbHV3OO78/+549p4hP7LnKl0hYeiMqO7C/2MuMzX3csj4g0GUMNY nqKGgeGmA3x/istG2DUDxnKkDtxg0KEYNECnuYLOxiNZrJGhYqmSb1aAoTlGF9hGkI7xNOQE4ga/T 7Ior55n3dwnMIXbiZi4ejGYHQksu6rpcP+FS4woNZdU3VFL5kNIPdvPvwA40qcBu6uxtWJ6ufJ2/u EGQDNLtg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nucEc-002CY1-EI; Fri, 27 May 2022 15:50:42 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 24/24] ocfs2: Use filemap_write_and_wait_range() in ocfs2_cow_sync_writeback() Date: Fri, 27 May 2022 16:50:36 +0100 Message-Id: <20220527155036.524743-25-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220527155036.524743-1-willy@infradead.org> References: <20220527155036.524743-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Remove the open-coding of filemap_fdatawait_range(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/ocfs2/refcounttree.c | 42 ++++++----------------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index e04358a46b68..1358981e80a3 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3146,48 +3146,18 @@ int ocfs2_cow_sync_writeback(struct super_block *sb, struct inode *inode, u32 cpos, u32 num_clusters) { - int ret = 0; - loff_t offset, end, map_end; - pgoff_t page_index; - struct page *page; + int ret; + loff_t start, end; if (ocfs2_should_order_data(inode)) return 0; - offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits; - end = offset + (num_clusters << OCFS2_SB(sb)->s_clustersize_bits); + start = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits; + end = start + (num_clusters << OCFS2_SB(sb)->s_clustersize_bits) - 1; - ret = filemap_fdatawrite_range(inode->i_mapping, - offset, end - 1); - if (ret < 0) { + ret = filemap_write_and_wait_range(inode->i_mapping, start, end); + if (ret < 0) mlog_errno(ret); - return ret; - } - - while (offset < end) { - page_index = offset >> PAGE_SHIFT; - map_end = ((loff_t)page_index + 1) << PAGE_SHIFT; - if (map_end > end) - map_end = end; - - page = find_or_create_page(inode->i_mapping, - page_index, GFP_NOFS); - BUG_ON(!page); - - wait_on_page_writeback(page); - if (PageError(page)) { - ret = -EIO; - mlog_errno(ret); - } else - mark_page_accessed(page); - - unlock_page(page); - put_page(page); - page = NULL; - offset = map_end; - if (ret) - break; - } return ret; }