From patchwork Mon Jan 9 05:18:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 40669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1985014wrt; Sun, 8 Jan 2023 21:20:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvbwSbwWrWJbt47H+yYWO+Dzv40l+aWTRT0/8sRNn2Z0jpqg6OFTd86ECZGBCiefkAgtrs X-Received: by 2002:a05:6a20:d38c:b0:af:a276:2f94 with SMTP id iq12-20020a056a20d38c00b000afa2762f94mr80565598pzb.35.1673241609091; Sun, 08 Jan 2023 21:20:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673241609; cv=none; d=google.com; s=arc-20160816; b=eiOaN/FY8YQiA5y+Ehovm6fJE1VP+oMjHwROkY5qzxLqtMp8bZZMNxvfJzXR9c61TX EM1K8yLleFgkZAR6MKPv8XgOoJQ1+FeatccfH66XihfmPd3d/t05de5vAlnVs6BNuKos 6Q7RzjXCAYUvcbELANV6j81OBip4Vs1tm7zqAhs0W7TJAeZNn8aTLwmy+wf6Fe0R2ZOW /HR79wE9aPFRjo9cq6YG4RSNzNUE5292vJSP54yfWRe+GbrM1wvaXwyciTPdvtHrFpWF E71l8YzhWTbSTeKXIiJByLWz7gc8/XdVqa5k/AtITJPBzR+u9uu/BIJ9d5NSbdQfwp6r 261g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=vQF/XULxVm6847KaRqQbhdaohxHXi2nEuadxTiR1ZyE=; b=BUDJN1jUW3cei121y4IfZqN153i2p7wHF3liI8Fw3pCJeum7R1TN4JHIKoQX0drca9 dmPo8yOJ5nhXPafyduD4aejcYToXdR/yPUqeTLXP0GZltJfcQozZum6N836hXKGqJd5R 6Pt23Y1LI23tVTuOSGBrz/OAbtEWPoNP+2RS9y6IStFNPg9W7qAexwQ2vxsWBS0EmUfJ xW5WZCxIC9o34P31fOk3A4SjZr6wp3UFqCMnXj28QKO/xd+VXN9DA/UnRl0rwMQAqJhn oLJrDe74jK2gVftd/Dy8vJkq3lPm/D0ase9p+ke4QjTJ0nAtrpfw+T+zIY+efbiZXMHL UneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=aRa6C07m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o25-20020a635a19000000b0045131d08c18si9194862pgb.244.2023.01.08.21.19.56; Sun, 08 Jan 2023 21:20:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=aRa6C07m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236374AbjAIFTM (ORCPT + 99 others); Mon, 9 Jan 2023 00:19:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234414AbjAIFST (ORCPT ); Mon, 9 Jan 2023 00:18:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC210DE9C; Sun, 8 Jan 2023 21:18:15 -0800 (PST) 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=vQF/XULxVm6847KaRqQbhdaohxHXi2nEuadxTiR1ZyE=; b=aRa6C07mcL3ngPuqUeUeiq9Ewx ojEY5TSS9TePzq8VcMu5ajWtwn4NiV+m5NNngSAtK9zTzdDs3q90VzpUCMIrSyZGbu7kEiTeRh619 6q3IWbwiybuoZMlQU/vqIim43gIyzhp3Ph8+GVUVj/vWGpTU/+Vxfh6YkJL/frk+TJxlOamIQqcWt IzYn4QhNA4rFF0qJuAkxUWsHMRoGHusUQ/kdpMG6Wvwysl2pFmTgzmP41oczAMhe2Rntw6fQfNV5C y5mvfiSAJm2MwpIQYvhXFRsv37zIzK32GV2QCdxDA5nlXXnWl94CSidw9tcoy3HcxKd6KOir4+OTQ wQw0SzcQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkYE-0020xc-8n; Mon, 09 Jan 2023 05:18:26 +0000 From: "Matthew Wilcox (Oracle)" Cc: "Matthew Wilcox (Oracle)" , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH 11/11] mm: Remove filemap_fdatawait_keep_errors() Date: Mon, 9 Jan 2023 05:18:23 +0000 Message-Id: <20230109051823.480289-12-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230109051823.480289-1-willy@infradead.org> References: <20230109051823.480289-1-willy@infradead.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754520993298625839?= X-GMAIL-MSGID: =?utf-8?q?1754520993298625839?= This function is now the same as filemap_fdatawait(), so change all callers to use that instead. Remove the comments which talk about keeping the errors around for other callers as this is now the only behaviour. Signed-off-by: Matthew Wilcox (Oracle) --- block/bdev.c | 8 +------- fs/fs-writeback.c | 7 +------ fs/xfs/scrub/bmap.c | 2 +- include/linux/pagemap.h | 2 -- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/block/bdev.c b/block/bdev.c index edc110d90df4..2fae19f0a5c2 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -1053,13 +1053,7 @@ void sync_bdevs(bool wait) if (!atomic_read(&bdev->bd_openers)) { ; /* skip */ } else if (wait) { - /* - * We keep the error status of individual mapping so - * that applications can catch the writeback error using - * fsync(2). See filemap_fdatawait_keep_errors() for - * details. - */ - filemap_fdatawait_keep_errors(inode->i_mapping); + filemap_fdatawait(inode->i_mapping); } else { filemap_fdatawrite(inode->i_mapping); } diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 6fba5a52127b..dc0158125e5d 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2598,12 +2598,7 @@ static void wait_sb_inodes(struct super_block *sb) spin_unlock(&inode->i_lock); rcu_read_unlock(); - /* - * We keep the error status of individual mapping so that - * applications can catch the writeback error using fsync(2). - * See filemap_fdatawait_keep_errors() for details. - */ - filemap_fdatawait_keep_errors(mapping); + filemap_fdatawait(mapping); cond_resched(); diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index d50d0eab196a..8f169047d410 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -64,7 +64,7 @@ xchk_setup_inode_bmap( */ error = filemap_fdatawrite(mapping); if (!error) - error = filemap_fdatawait_keep_errors(mapping); + error = filemap_fdatawait(mapping); if (error && (error != -ENOSPC && error != -EIO)) goto out; } diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7fe2a5ec1c12..69190335deb1 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -40,8 +40,6 @@ static inline int filemap_fdatawait(struct address_space *mapping) return filemap_fdatawait_range(mapping, 0, LLONG_MAX); } -#define filemap_fdatawait_keep_errors(mapping) filemap_fdatawait(mapping) - bool filemap_range_has_page(struct address_space *, loff_t lstart, loff_t lend); int filemap_write_and_wait_range(struct address_space *mapping, loff_t lstart, loff_t lend);