]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bcachefs: Fix assertion popping in transaction commit path
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 16 Dec 2020 18:35:16 +0000 (13:35 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:44 +0000 (17:08 -0400)
commitaa8889c07abecd7db7b2c0beb61db921fbafe04f
treeed24fd86cf23c94c6319226b29283f5b1d9553fb
parentf3721e12d07ab3c3e400a1a635e999ef72780de4
bcachefs: Fix assertion popping in transaction commit path

We can't be holding read locks on btree nodes when we go to take write
locks: this would deadlock if another thread is holding an intent lock
on the node we have a read lock on, and it tries to commit and upgrade
to a write lock.

But instead of triggering an assertion, if this happens we can just
upgrade the read lock to an intent lock.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update_leaf.c