]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bcachefs: Better approach to write vs. read lock deadlocks
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 8 Sep 2021 01:25:32 +0000 (21:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:12 +0000 (17:09 -0400)
commitcaaa66aa546a27e75fb3cf32df1906140f85f1c9
tree670ae5eefa4a486f94181b84108e9f562f1a7a88
parentb301105b48d2805ca0e29b1b0f660cf2232511ee
bcachefs: Better approach to write vs. read lock deadlocks

Instead of unconditionally upgrading read locks to intent locks in
do_bch2_trans_commit(), this patch changes the path that takes write
locks to first trylock, and then if trylock fails check if we have a
conflicting read lock, and restart the transaction if necessary.

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