[Concept,20/26] fs: ext4l: Add CONFIG_EXT4L_DEBUG to control messages

Message ID 20251222115639.700578-21-sjg@u-boot.org
State New
Headers
Series fs: ext4l: Add support for mounting ext4 filesystems (part G) |

Commit Message

Simon Glass Dec. 22, 2025, 11:56 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add a Kconfig option to control ext4_msg() output. By default, mount
messages and other informational output are suppressed to reduce
console noise. Enable CONFIG_EXT4L_DEBUG to restore these messages
for debugging.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/Kconfig | 9 +++++++++
 fs/ext4l/super.c | 3 +++
 2 files changed, 12 insertions(+)
  

Patch

diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig
index f1fbe3b1000..998f0f45474 100644
--- a/fs/ext4l/Kconfig
+++ b/fs/ext4l/Kconfig
@@ -22,3 +22,12 @@  config EXT4_JOURNAL
 	  before committing them to the filesystem.
 
 	  If unsure, say Y.
+
+config EXT4L_DEBUG
+	bool "Enable ext4l debug messages"
+	depends on FS_EXT4L
+	help
+	  Enable debug and informational messages from the ext4l filesystem.
+	  This includes mount messages and other ext4_msg() output.
+
+	  If unsure, say N.
diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c
index f986ca6e0b6..47e0b2c92e8 100644
--- a/fs/ext4l/super.c
+++ b/fs/ext4l/super.c
@@ -946,6 +946,9 @@  void __ext4_msg(struct super_block *sb,
 	struct va_format vaf;
 	va_list args;
 
+	if (!IS_ENABLED(CONFIG_EXT4L_DEBUG))
+		return;
+
 	if (sb) {
 		atomic_inc(&EXT4_SB(sb)->s_msg_count);
 		if (!___ratelimit(&(EXT4_SB(sb)->s_msg_ratelimit_state),