On Tue, Sep 19, 2023 at 10:37:31PM -0400, Kent Overstreet wrote:
> On Fri, Sep 15, 2023 at 03:57:34PM +0300, Dan Carpenter wrote:
> > Hello Kent Overstreet,
> > 
> > The patch 93a640e2570b: "bcachefs: GFP_NOIO -> GFP_NOFS" from May 28,
> > 2023 (linux-next), leads to the following Smatch static checker
> > warning:
> > 
> > fs/bcachefs/journal_io.c:1461 journal_buf_realloc() warn: sleeping in 
> > atomic context
> > fs/bcachefs/journal_io.c:1662 bch2_journal_entries_postprocess() warn: 
> > sleeping in atomic context
> > fs/bcachefs/journal_io.c:1764 bch2_journal_write() warn: sleeping in atomic 
> > context
> > fs/bcachefs/journal_io.c:788 jset_validate() warn: sleeping in atomic 
> > context
> > fs/bcachefs/replicas.c:439 bch2_mark_replicas() warn: sleeping in atomic 
> > context
> > 
> > All this sleeping in atomic warnings start in journal_write_done()
> > where it takes spin_lock(&j->lock) so preempt is disabled.
> 
> 
> >From 0528bebd8b42ce43a39da8e911bf21825f5085dd Mon Sep 17 00:00:00 2001
> From: Kent Overstreet <[email protected]>
> Date: Tue, 19 Sep 2023 22:36:30 -0400
> Subject: [PATCH] bcachefs: drop journal lock before calling journal_write
> 
> bch2_journal_write() expects process context, it takes journal_lock as
> needed.
> 
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Kent Overstreet <[email protected]>

Thanks!

regards,
dan carpenter

Reply via email to