[PATCH] xfs: add __printf attribute to xfs_buf_alert_ratelimited()

From: Adrián García Casado

Date: Tue Oct 20 2026 - 15:56:49 EST


xfs_printk_level() and _xfs_alert_tag() in fs/xfs/xfs_message.h are
annotated with __printf(3, 4), but xfs_buf_alert_ratelimited() in the
same header is missing the attribute.

Because xfs_buf_alert_ratelimited() formats its variadic arguments via
struct va_format and %pV, the compiler does not suggest the format
attribute under -Wsuggest-attribute=format, and callers do not get
compile-time format string checking.

Add __printf(3, 4) to xfs_buf_alert_ratelimited() to match the other
logging helpers in fs/xfs/xfs_message.h.

Signed-off-by: Adrián García Casado <adriangarciacasado42@xxxxxxxxx>
---
fs/xfs/xfs_message.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_message.h b/fs/xfs/xfs_message.h
index 811b885f41..bfae8dddc9 100644
--- a/fs/xfs/xfs_message.h
+++ b/fs/xfs/xfs_message.h
@@ -87,6 +87,7 @@ void asswarn(struct xfs_mount *mp, char *expr, char *f, int l);

extern void xfs_hex_dump(const void *p, int length);

+__printf(3, 4)
void xfs_buf_alert_ratelimited(struct xfs_buf *bp, const char *rlmsg,
const char *fmt, ...);

--
2.39.5