Received: from mailgw1.hygon.cn (unknown [101.204.27.37]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C4873AC0EF; Mon, 14 Sep 2026 06:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=101.204.27.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789366555; cv=none; b=BKXQ6mpxj9OeoGba5lUcibMcV5+UMzXjKqjBHRKM8iKfSNVlQill95rYqjnuIk1Wf4lZq5Cy/Q3V2KxVDCEqg0e98APXY5Dm0O5UyilD3Q6pSd91cwvdwxgmvEji5n1cHQBTUkg9WNyR7P5Z5IcATXXrwrBx0dg3EgBqEQJLYyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789366555; c=relaxed/simple; bh=7aBG096Seog8JCOWQO3Ag7h9GZlL4pvzcDvzlFs60Rc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=F7fnyVmaYva/8l7PPlZYY17lTCCSeC2MxQ9EbcWFeciYEwacE13suTHMg0+OGiMyMrQdoWJqbClFerlMKgJSTwlggAea+lMd7rKuJ1jCthyKkRvpDunuHblsWRPPIJB/LsnV2s3QDEkr2TbVFVBAA/VuBZQ/OC/5aCf5ElHIX3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hygon.cn; spf=pass smtp.mailfrom=hygon.cn; arc=none smtp.client-ip=101.204.27.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hygon.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hygon.cn Received: from maildlp1.hygon.cn (unknown [127.0.0.1]) by mailgw1.hygon.cn (Postfix) with ESMTP id 4hjvyv6rkkz2CZqx; Mon, 14 Sep 2026 14:15:35 +0800 (CST) Received: from maildlp1.hygon.cn (unknown [172.23.18.60]) by mailgw1.hygon.cn (Postfix) with ESMTP id 4hjvys0SLkz2CZMr; Mon, 14 Sep 2026 14:15:33 +0800 (CST) Received: from cncheex04.Hygon.cn (unknown [172.23.18.114]) by maildlp1.hygon.cn (Postfix) with ESMTPS id 697E34B59; Mon, 14 Sep 2026 14:15:30 +0800 (CST) Received: from hsj-2U-Workstation.hygon.cn (172.19.24.226) by cncheex04.Hygon.cn (172.23.18.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Mon, 14 Sep 2026 14:15:31 +0800 From: Huang Shijie To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , Huang Shijie Subject: [RFC PATCH 2/3] fs/super: introduce a helper sb_inodes_empty() Date: Mon, 14 Sep 2026 14:14:48 +0800 Message-ID: <20260914061449.4024632-3-huangsj@hygon.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260914061449.4024632-1-huangsj@hygon.cn> References: <20260914061449.4024632-1-huangsj@hygon.cn> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: cncheex06.Hygon.cn (172.23.18.116) To cncheex04.Hygon.cn (172.23.18.114) Introduce a helper sb_inodes_empty() which is used to detect if the inodes list is empty. Signed-off-by: Huang Shijie --- fs/super.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 05e443173038..4b1314545522 100644 --- a/fs/super.c +++ b/fs/super.c @@ -724,6 +724,11 @@ void retire_super(struct super_block *sb) } EXPORT_SYMBOL(retire_super); +static bool sb_inodes_empty(struct super_block *sb) +{ + return list_empty(&sb->s_inodes); +} + /** * generic_shutdown_super - common helper for ->kill_sb() * @sb: superblock to kill @@ -774,7 +779,7 @@ void generic_shutdown_super(struct super_block *sb) */ fscrypt_destroy_keyring(sb); - if (CHECK_DATA_CORRUPTION(!list_empty(&sb->s_inodes), NULL, + if (CHECK_DATA_CORRUPTION(!sb_inodes_empty(sb), NULL, "VFS: Busy inodes after unmount of %s (%s)", sb->s_id, sb->s_type->name)) { /* -- 2.53.0