bcachefs: Mark write locks before taking lock
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 26 Aug 2022 18:55:00 +0000 (14:55 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:40 +0000 (17:09 -0400)
commit546180874ade7225676bc0cd5ea4e2388e2374bc
tree7e20a1ce5a97ca2b956f38b99ef01862bf55fead
parent534a591e4cf98d036e478b93de4a95ff126fb018
bcachefs: Mark write locks before taking lock

six locks are unfair: while a thread is blocked trying to take a write
lock, new read locks will fail. The new deadlock cycle detector makes
use of our existing lock tracing, so we need to tell it we're holding a
write lock before we take the lock for it to work correctly.

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