Re: [PATCH v1] bcachefs: use mutex_trylock in bch2_replicas_entry_validate

From: Kent Overstreet
Date: Mon Oct 07 2024 - 17:04:48 EST


On Mon, Oct 07, 2024 at 08:55:49PM GMT, Piotr Zalewski wrote:
> Use mutex_trylock instead of mutex_lock in bch2_replicas_entry_validate to
> prevent potential deadlock[1].
>
> [1] https://syzkaller.appspot.com/bug?extid=4d24267b490e2b68a5fa

No good, skipping locking is not the right way to fix this.

I fixed this with the below patch - we've got a different way of
checking if a device exists when the filesystem is online.