From 15a07f2eae6852dc4f3c1172601d592be0f5756f Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 11 Apr 2020 12:30:30 -0400 Subject: [PATCH] bcachefs: Improve lockdep annotation in journalling code bch2_journal_res_get() in nonblocking mode is equivalent to a trylock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/journal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index f8867f86318af..81e26ba43fa12 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -346,7 +346,9 @@ static inline int bch2_journal_res_get(struct journal *j, struct journal_res *re return ret; out: if (!(flags & JOURNAL_RES_GET_CHECK)) { - lock_acquire_shared(&j->res_map, 0, 0, NULL, _THIS_IP_); + lock_acquire_shared(&j->res_map, 0, + (flags & JOURNAL_RES_GET_NONBLOCK) != 0, + NULL, _THIS_IP_); EBUG_ON(!res->ref); } return 0; -- 2.30.2