summaryrefslogtreecommitdiff
path: root/fs/bcachefs/sysfs.c
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/sysfs.c
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/sysfs.c')
-rw-r--r--fs/bcachefs/sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index 77f92d537af6..54e1071ecfeb 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -379,7 +379,7 @@ static void bch2_btree_wakeup_all(struct bch_fs *c)
{
struct btree_trans *trans;
- mutex_lock(&c->btree_trans_lock);
+ seqmutex_lock(&c->btree_trans_lock);
list_for_each_entry(trans, &c->btree_trans_list, list) {
struct btree_bkey_cached_common *b = READ_ONCE(trans->locking);
@@ -387,7 +387,7 @@ static void bch2_btree_wakeup_all(struct bch_fs *c)
six_lock_wakeup_all(&b->lock);
}
- mutex_unlock(&c->btree_trans_lock);
+ seqmutex_unlock(&c->btree_trans_lock);
}
SHOW(bch2_fs)