public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Add missing error handling
@ 2025-04-12 10:20 Alan Huang
  2025-04-13  9:59 ` Kent Overstreet
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Huang @ 2025-04-12 10:20 UTC (permalink / raw)
  To: kent.overstreet; +Cc: linux-bcachefs, Alan Huang, syzbot+d10151bf01574a09a915

Reported-by: syzbot+d10151bf01574a09a915@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/recovery.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index d2b07f602da9..606d684e6f23 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1125,7 +1125,10 @@ int bch2_fs_initialize(struct bch_fs *c)
 	 * journal_res_get() will crash if called before this has
 	 * set up the journal.pin FIFO and journal.cur pointer:
 	 */
-	bch2_fs_journal_start(&c->journal, 1);
+	ret = bch2_fs_journal_start(&c->journal, 1);
+	if (ret)
+		goto err;
+
 	set_bit(BCH_FS_accounting_replay_done, &c->flags);
 	bch2_journal_set_replay_done(&c->journal);
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bcachefs: Add missing error handling
  2025-04-12 10:20 [PATCH] bcachefs: Add missing error handling Alan Huang
@ 2025-04-13  9:59 ` Kent Overstreet
  2025-04-13 14:24   ` Alan Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Overstreet @ 2025-04-13  9:59 UTC (permalink / raw)
  To: Alan Huang; +Cc: linux-bcachefs, syzbot+d10151bf01574a09a915

On Sat, Apr 12, 2025 at 06:20:49PM +0800, Alan Huang wrote:
> Reported-by: syzbot+d10151bf01574a09a915@syzkaller.appspotmail.com
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>

This was a silly mistake.

In the past I've thought about going through and marking huge swaths of
functions as __must_check, maybe that would actually be worth doing?

> ---
>  fs/bcachefs/recovery.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
> index d2b07f602da9..606d684e6f23 100644
> --- a/fs/bcachefs/recovery.c
> +++ b/fs/bcachefs/recovery.c
> @@ -1125,7 +1125,10 @@ int bch2_fs_initialize(struct bch_fs *c)
>  	 * journal_res_get() will crash if called before this has
>  	 * set up the journal.pin FIFO and journal.cur pointer:
>  	 */
> -	bch2_fs_journal_start(&c->journal, 1);
> +	ret = bch2_fs_journal_start(&c->journal, 1);
> +	if (ret)
> +		goto err;
> +
>  	set_bit(BCH_FS_accounting_replay_done, &c->flags);
>  	bch2_journal_set_replay_done(&c->journal);
>  
> -- 
> 2.48.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bcachefs: Add missing error handling
  2025-04-13  9:59 ` Kent Overstreet
@ 2025-04-13 14:24   ` Alan Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Huang @ 2025-04-13 14:24 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: linux-bcachefs, syzbot+d10151bf01574a09a915

On Apr 13, 2025, at 17:59, Kent Overstreet <kent.overstreet@linux.dev> wrote:
> 
> On Sat, Apr 12, 2025 at 06:20:49PM +0800, Alan Huang wrote:
>> Reported-by: syzbot+d10151bf01574a09a915@syzkaller.appspotmail.com
>> Signed-off-by: Alan Huang <mmpgouride@gmail.com>
> 
> This was a silly mistake.
> 
> In the past I've thought about going through and marking huge swaths of
> functions as __must_check, maybe that would actually be worth doing?

Yeah, that’s a good idea.

> 
>> ---
>> fs/bcachefs/recovery.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
>> index d2b07f602da9..606d684e6f23 100644
>> --- a/fs/bcachefs/recovery.c
>> +++ b/fs/bcachefs/recovery.c
>> @@ -1125,7 +1125,10 @@ int bch2_fs_initialize(struct bch_fs *c)
>> * journal_res_get() will crash if called before this has
>> * set up the journal.pin FIFO and journal.cur pointer:
>> */
>> - bch2_fs_journal_start(&c->journal, 1);
>> + ret = bch2_fs_journal_start(&c->journal, 1);
>> + if (ret)
>> + goto err;
>> +
>> set_bit(BCH_FS_accounting_replay_done, &c->flags);
>> bch2_journal_set_replay_done(&c->journal);
>> 
>> -- 
>> 2.48.1
>> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-13 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 10:20 [PATCH] bcachefs: Add missing error handling Alan Huang
2025-04-13  9:59 ` Kent Overstreet
2025-04-13 14:24   ` Alan Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox