From patchwork Thu Jul 20 14:04:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13320584 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 AE8E1EB64DA for ; Thu, 20 Jul 2023 14:07:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45EC8280110; Thu, 20 Jul 2023 10:07:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40E5D28004C; Thu, 20 Jul 2023 10:07:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D6F9280110; Thu, 20 Jul 2023 10:07:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1ED0228004C for ; Thu, 20 Jul 2023 10:07:09 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E1824A0172 for ; Thu, 20 Jul 2023 14:07:07 +0000 (UTC) X-FDA: 81032166894.13.A49D27E Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf11.hostedemail.com (Postfix) with ESMTP id 9324040084 for ; Thu, 20 Jul 2023 14:05:02 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=u5fs6hBa; dmarc=none; spf=none (imf11.hostedemail.com: domain of BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689861903; 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=MU6yo3/JkEwDpfVtYsrPOrA7WaINTrJRX/tZStkXyyg=; b=T/3ytujlw+aInKXNu3K/i/aTbTxJ6VvgwYqkh30LeZyhS+es4wBDSW1vgzGl/cTz6oDusb /ht6V9qCf7pwvIPSvwqmf2v0m9Ew0hh9XjapD4IuKf153MY82AzvvprDaUVMoc0s8Z4pon fs+APCAGzSoZCG1rBZxZrh2qWvfjsPI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=u5fs6hBa; dmarc=none; spf=none (imf11.hostedemail.com: domain of BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689861903; a=rsa-sha256; cv=none; b=rTblVZEi7G34taLNUj2ZnMiGgRGma+CL6uTCKbJmA2lfxbcY086rP9hw9g03hM+WJvMywK 2kwR1l+LBZWRRCzl65WNtQz2w7829Ejn0Z8tev2TYk06BMm8GUqjHIkNcGuwaWShVOADpC HJQfgSar9CPgJ8F8i8fX2gZVAqOMbsE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=MU6yo3/JkEwDpfVtYsrPOrA7WaINTrJRX/tZStkXyyg=; b=u5fs6hBazs5UDdEUCHFufcXQuV M8Mhc6YEu2dgb1zeZYAHYeiE99a04zapRuwjalF5XCByuAKRSTJrigMBq0DCJiRLCkuxtk6B9dmK8 T+nYF4UnUOjqOlAU9gI9CePE6IRoAKps8uMUxaYIL7cGIYDhwvqoeOdghhLfirCoeCNMzidjoIK1n 6d7+K1Ts6LvaBv35Xv6GNw1zpaFFZDUhBFclPHtdwSwC0UborwfvNvgrQncy3kUge2+lKSgE1xuPt AGEjbPHNDq+DnlTCx7zX0fJmLdVJRhHTWZCOS8F6s9d6/19YFb6+XRYMdpnoH00ELwTsZMGJwnQtn eUCBTUCA==; Received: from [2001:4bb8:19a:298e:a587:c3ea:b692:5b8d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qMUH3-00BKoB-1Q; Thu, 20 Jul 2023 14:04:57 +0000 From: Christoph Hellwig To: Jens Axboe Cc: "Darrick J. Wong" , Andrew Morton , Matthew Wilcox , Christian Brauner , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] fs: remove emergency_thaw_bdev Date: Thu, 20 Jul 2023 16:04:47 +0200 Message-Id: <20230720140452.63817-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230720140452.63817-1-hch@lst.de> References: <20230720140452.63817-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Stat-Signature: dxzky1j7rka8mm8z4b1s4rocafqppqxd X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9324040084 X-HE-Tag: 1689861902-216707 X-HE-Meta: U2FsdGVkX18Io1zby9u7m+ErMZhKOv5rD77HbW8yXRq2hZfRb++umY28TVBNLQP50SVZLHoTRTYfitzDSa+LEkmD8B8dXdw5glubpf6vDSUR1xNnzQ9SdmFWJHKZ1QoI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1wEd9ziWmRWszt/H7o5XgKuHhGRzAep+1zsuENynRkGZHscPtGclJh7i4WCUwi+OAi9MM3IjevXtBP+0apS+UIGS5BESSHYLbaZt5TXPnO3ViySnqF2TjjDC2Aac76176zVji6oSGFEC59yJ48IPfbEViFCHlMj6KTEgtauTd+fRDPuloC2R8zmS31N38pNgL4NaYIX0qbRY93wHXCmGq6OTi4Ujj2SwZ+hb7TdfDpCNtjFqfiXGXXbCZMcReR7/Q= 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: Fold emergency_thaw_bdev into it's only caller, to prepare for buffer.c to be built only when buffer_head support is enabled. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Luis Chamberlain --- fs/buffer.c | 6 ------ fs/internal.h | 6 ------ fs/super.c | 4 +++- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index bd091329026c0f..376f468e16662d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -562,12 +562,6 @@ static int osync_buffers_list(spinlock_t *lock, struct list_head *list) return err; } -void emergency_thaw_bdev(struct super_block *sb) -{ - while (sb->s_bdev && !thaw_bdev(sb->s_bdev)) - printk(KERN_WARNING "Emergency Thaw on %pg\n", sb->s_bdev); -} - /** * sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers * @mapping: the mapping which wants those buffers written diff --git a/fs/internal.h b/fs/internal.h index f7a3dc11102647..d538d832fd608b 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -23,16 +23,10 @@ struct mnt_idmap; */ #ifdef CONFIG_BLOCK extern void __init bdev_cache_init(void); - -void emergency_thaw_bdev(struct super_block *sb); #else static inline void bdev_cache_init(void) { } -static inline int emergency_thaw_bdev(struct super_block *sb) -{ - return 0; -} #endif /* CONFIG_BLOCK */ /* diff --git a/fs/super.c b/fs/super.c index e781226e28800c..bc666e7ee1a984 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1029,7 +1029,9 @@ static void do_thaw_all_callback(struct super_block *sb) { down_write(&sb->s_umount); if (sb->s_root && sb->s_flags & SB_BORN) { - emergency_thaw_bdev(sb); + if (IS_ENABLED(CONFIG_BLOCK)) + while (sb->s_bdev && !thaw_bdev(sb->s_bdev)) + pr_warn("Emergency Thaw on %pg\n", sb->s_bdev); thaw_super_locked(sb); } else { up_write(&sb->s_umount);