[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPZ5DTEGi8RXBMui823bwnt96PcqZSavH8AQ+LPhRs=sJ-Br1Q@mail.gmail.com>
Date: Wed, 2 Apr 2025 22:03:10 +0530
From: Bharadwaj Raju <bharadwaj.raju777@...il.com>
To: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, shuah@...nel.org,
linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev,
syzbot+c82cd2906e2f192410bb@...kaller.appspotmail.com
Subject: Re: [PATCH] bcachefs: don't call sleeping funcs when handling
inconsistency errors
On Wed, Apr 2, 2025 at 9:47 PM Kent Overstreet
<kent.overstreet@...ux.dev> wrote:
>
> On Wed, Apr 02, 2025 at 09:40:40PM +0530, Bharadwaj Raju wrote:
> > In bch2_bkey_pick_read_device, we're in an RCU lock. So, we can't call
> > any potentially-sleeping functions. However, we call bch2_dev_rcu,
> > which calls bch2_fs_inconsistent in its error case. That then calls
> > bch2_prt_print on a non-atomic printbuf, as well as uses the blocking
> > variant of bch2_print_string_as_lines, both of which lead to calls to
> > potentially-sleeping functions, namely krealloc with GFP_KERNEL
> > and console_lock respectively.
> >
> > Give a nonzero atomic to the printbuf, and use the nonblocking variant
> > of bch2_print_string_as_lines.
>
> Sorry, beat you to it :)
>
> You also missed the one the syzbot report actually hit -
> bch2_inconsistent_error().
Oops, thank you.
If I'm not wrong, though, the bch2_print_string_as_lines
still needs to be changed to bch2_print_string_as_lines_nonblocking?
In my testing that also produces the same BUG warning.
Should I make a patch for that?
Powered by blists - more mailing lists