From: Kent Overstreet Date: Wed, 25 Jan 2023 15:18:32 +0000 (-0500) Subject: bcachefs: Use trylock in bch2_prt_backtrace() X-Git-Tag: io_uring-6.7-2023-11-10~119^2~583 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3e57db65cdd93bee55d1ecf53ff4ab895e05c40e;p=linux-block.git bcachefs: Use trylock in bch2_prt_backtrace() Easy workaround for a lockdep splat - and since bch2_prt_backtrace() is only used in debug code this is fine. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 31934f7a6436..e6672b67ae32 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -270,11 +270,9 @@ int bch2_prt_backtrace(struct printbuf *out, struct task_struct *task) { unsigned long entries[32]; unsigned i, nr_entries; - int ret; - ret = down_read_killable(&task->signal->exec_update_lock); - if (ret) - return ret; + if (!down_read_trylock(&task->signal->exec_update_lock)) + return 0; nr_entries = stack_trace_save_tsk(task, entries, ARRAY_SIZE(entries), 0); for (i = 0; i < nr_entries; i++) {