lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <nlp6womaeq5tgt4wfae6mq5fl5w3sg7bqkyu2ctsaunxuaemqg@os4cz7r3tbyz>
Date: Wed, 2 Apr 2025 14:25:21 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Bharadwaj Raju <bharadwaj.raju777@...il.com>
Cc: linux-bcachefs@...r.kernel.org, shuah@...nel.org, 
	linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH bcachefs-testing] bcachefs: use nonblocking variant of
 print_string_as_lines in error path

On Wed, Apr 02, 2025 at 11:45:53PM +0530, Bharadwaj Raju wrote:
> The inconsistency error path calls print_string_as_lines, which calls
> console_lock, which is a potentially-sleeping function and so can't be
> called in an atomic context.
> 
> Replace calls to it with the nonblocking variant which is safe to call.
> 
> Signed-off-by: Bharadwaj Raju <bharadwaj.raju777@...il.com>

Looks good, applying.

> ---
>  fs/bcachefs/error.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c
> index b885bd92834c..baf5dfb32298 100644
> --- a/fs/bcachefs/error.c
> +++ b/fs/bcachefs/error.c
> @@ -34,7 +34,7 @@ bool __bch2_inconsistent_error(struct bch_fs *c, struct printbuf *out)
>  				   journal_cur_seq(&c->journal));
>  		return true;
>  	case BCH_ON_ERROR_panic:
> -		bch2_print_string_as_lines(KERN_ERR, out->buf);
> +		bch2_print_string_as_lines_nonblocking(KERN_ERR, out->buf);
>  		panic(bch2_fmt(c, "panic after error"));
>  		return true;
>  	default:
> @@ -71,7 +71,7 @@ static bool bch2_fs_trans_inconsistent(struct bch_fs *c, struct btree_trans *tra
>  	if (trans)
>  		bch2_trans_updates_to_text(&buf, trans);
>  	bool ret = __bch2_inconsistent_error(c, &buf);
> -	bch2_print_string_as_lines(KERN_ERR, buf.buf);
> +	bch2_print_string_as_lines_nonblocking(KERN_ERR, buf.buf);
>  
>  	printbuf_exit(&buf);
>  	return ret;
> -- 
> 2.49.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ