diff mbox series

btrfs: disable rate limiting when debug enabled

Message ID a0c406abae81f2824ed822ef7f5e85650d8424b1.1727219806.git.loemra.dev@gmail.com (mailing list archive)
State New, archived
Headers show
Series btrfs: disable rate limiting when debug enabled | expand

Commit Message

Leo Martins Sept. 24, 2024, 11:42 p.m. UTC
Disable ratelimiting for btrfs_printk when CONFIG_BTRFS_DEBUG is
enabled. This allows for more verbose output which is often needed by
functions like btrfs_dump_space_info().

Signed-off-by: Leo Martins <loemra.dev@gmail.com>
---
 fs/btrfs/messages.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Qu Wenruo Sept. 25, 2024, 12:27 a.m. UTC | #1
在 2024/9/25 09:12, Leo Martins 写道:
> Disable ratelimiting for btrfs_printk when CONFIG_BTRFS_DEBUG is
> enabled. This allows for more verbose output which is often needed by
> functions like btrfs_dump_space_info().
>
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/messages.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c
> index 77752eec125d9..363fd28c02688 100644
> --- a/fs/btrfs/messages.c
> +++ b/fs/btrfs/messages.c
> @@ -239,7 +239,8 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
>   	vaf.fmt = fmt;
>   	vaf.va = &args;
>
> -	if (__ratelimit(ratelimit)) {
> +	/* Do not ratelimit if CONFIG_BTRFS_DEBUG is enabled. */
> +	if (IS_ENABLED(CONFIG_BTRFS_DEBUG) || __ratelimit(ratelimit)) {
>   		if (fs_info) {
>   			char statestr[STATE_STRING_BUF_LEN];
>
David Sterba Oct. 1, 2024, 5:01 p.m. UTC | #2
On Tue, Sep 24, 2024 at 04:42:29PM -0700, Leo Martins wrote:
> Disable ratelimiting for btrfs_printk when CONFIG_BTRFS_DEBUG is
> enabled. This allows for more verbose output which is often needed by
> functions like btrfs_dump_space_info().
> 
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>

Added to for-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c
index 77752eec125d9..363fd28c02688 100644
--- a/fs/btrfs/messages.c
+++ b/fs/btrfs/messages.c
@@ -239,7 +239,8 @@  void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	if (__ratelimit(ratelimit)) {
+	/* Do not ratelimit if CONFIG_BTRFS_DEBUG is enabled. */
+	if (IS_ENABLED(CONFIG_BTRFS_DEBUG) || __ratelimit(ratelimit)) {
 		if (fs_info) {
 			char statestr[STATE_STRING_BUF_LEN];