mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carlos Maiolino <cem@kernel.org>
To: "Adrián García Casado" <adriangarciacasado42@gmail.com>
Cc: "Darrick J . Wong" <djwong@kernel.org>,
	linux-xfs@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: add __printf attribute to xfs_buf_alert_ratelimited()
Date: Wed, 21 Oct 2026 11:36:42 +0200	[thread overview]
Message-ID: <atiHnmKqL2TNNNVm@cronus.toxiclabs.cc> (raw)
In-Reply-To: <20261020195628.248878-1-adriangarciacasado42@gmail.com>

On Tue, Oct 20, 2026 at 09:56:28PM +0200, Adrián García Casado wrote:
> 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@gmail.com>
> ---
>  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, ...);
>  

Seems reasonable.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> -- 
> 2.39.5
> 
> 

      reply	other threads:[~2026-10-21  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 19:56 Adrián García Casado
2026-10-21  9:36 ` Carlos Maiolino [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atiHnmKqL2TNNNVm@cronus.toxiclabs.cc \
    --to=cem@kernel.org \
    --cc=adriangarciacasado42@gmail.com \
    --cc=djwong@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®