summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-19 21:01:13 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:04 -0400
commita5b696ee6e10103def82ea9abc18958912e81b00 (patch)
treec8b0dadf44dd7441a92c2081b7b78202386bd3bc /fs/bcachefs/bcachefs.h
parent6547ebabdaac4407ccc978f63f4dc4d9f8936783 (diff)
bcachefs: seqmutex; fix a lockdep splat
We can't be holding btree_trans_lock while copying to user space, which might incur a page fault. To fix this, convert it to a seqmutex so we can unlock/relock. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 0dfa42e297e0..4199b42db640 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -208,6 +208,7 @@
#include "fifo.h"
#include "nocow_locking_types.h"
#include "opts.h"
+#include "seqmutex.h"
#include "util.h"
#ifdef CONFIG_BCACHEFS_DEBUG
@@ -779,7 +780,7 @@ struct bch_fs {
} btree_write_stats[BTREE_WRITE_TYPE_NR];
/* btree_iter.c: */
- struct mutex btree_trans_lock;
+ struct seqmutex btree_trans_lock;
struct list_head btree_trans_list;
mempool_t btree_paths_pool;
mempool_t btree_trans_mem_pool;