Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF2454156C5; Sat, 12 Sep 2026 08:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789202242; cv=none; b=KJpEqnCKuAICH2woOQrbrmwqtINBSOMxE2lou8F7BKrcny//qmM3wtLSuSCGMRoMqDI86Po2KG12Ai2LDiUd0mMM8Xc2297tJ/ghyRlYACVQXdD5t4EfmY85Qkpk8k7KlNWIhONC32pVbOxj/22LfEp3VY4KuKkOR0C6nHR/dek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789202242; c=relaxed/simple; bh=8HLewUY8Mp5aEMSnLXDzS7EA1/kU7klNCwIhSkOe+OY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uuH3YNizn32Mgt0XUFIX0pOl8p6Y7u92ynRS0wo0fwv2omYp3lv6G5sILjJ3mQyTYZwew/cSuSsj8yo6+RO0SzwfhZfna+uirQKyh4HkWddwBVNQXNiHZh/xDVTptszpUAHtZzEJFHRhCW83+Pnvq43HXJzoh2pAiMN1zkGHtaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YTDS1FJz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YTDS1FJz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D471F000FF; Sat, 12 Sep 2026 08:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789202240; bh=xD12980yUijOo4I72VPmkIk2yzWoSlrsOz7NvQOX47Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YTDS1FJz6BmBHSFg7aagz5E/7K2NpSnxb43QsiGwlyR7fnHzHMLOnmxmaEMuXgBee DcvwjjN0AcnLyUr64H7sCWJE8BGZDT4iiG1+oV2suFnqTQtiJOwDEoOJUG+NyryTZH AHfFFEIYHE+yEYdAyg7p/LLj0wtMSrNCDTFrB8b0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tigran Aivazian , Jan Kara , Baokun Li , Theodore Tso , Sasha Levin Subject: [PATCH 7.2 1162/1815] ext4: fix spurious message about orphan cleanup on RO fs Date: Sat, 12 Sep 2026 08:48:32 +0200 Message-ID: <20260912065716.295058444@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jan Kara [ Upstream commit 5aa98f874c013bcce9bb84ffded2f0ef886e4e33 ] When orphan_file feature is enabled, ext4_orphan_cleanup() was always walking through the orphan file looking for orphan inodes. This is mostly harmless but for read-only filesystem it results in spurious "orphan cleanup on readonly fs" message and in other cornercases it could result in similar somewhat misleading messages. Skip orphan cleanup if the orphan file is empty to avoid confusing messages. Fixes: 02f310fcf47f ("ext4: Speedup ext4 orphan inode handling") Reported-by: Tigran Aivazian Signed-off-by: Jan Kara Reviewed-by: Baokun Li Link: https://patch.msgid.link/20260803160037.64285-2-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/orphan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c index 7095ba1564f65..e7fe1a99d4855 100644 --- a/fs/ext4/orphan.c +++ b/fs/ext4/orphan.c @@ -388,7 +388,7 @@ void ext4_orphan_cleanup(struct super_block *sb, struct ext4_super_block *es) struct ext4_orphan_info *oi = &EXT4_SB(sb)->s_orphan_info; int inodes_per_ob = ext4_inodes_per_orphan_block(sb); - if (!es->s_last_orphan && !oi->of_blocks) { + if (!es->s_last_orphan && ext4_orphan_file_empty(sb)) { ext4_debug("no orphan inodes to clean up\n"); return; } -- 2.53.0