From: Kent Overstreet Date: Sat, 21 Mar 2020 18:47:00 +0000 (-0400) Subject: bcachefs: Fix a locking bug in fsck X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0728eed7b6ec673d2b6e0f86b6daf240a2948292;p=linux.git bcachefs: Fix a locking bug in fsck This works around a btree locking issue - we can't be holding read locks while taking write locks, which currently means we can't have live iterators holding read locks at commit time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 902c8da9dc15a..936e6366cb047 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -478,7 +478,8 @@ static int check_extents(struct bch_fs *c) bch_verbose(c, "checking extents"); iter = bch2_trans_get_iter(&trans, BTREE_ID_EXTENTS, - POS(BCACHEFS_ROOT_INO, 0), 0); + POS(BCACHEFS_ROOT_INO, 0), + BTREE_ITER_INTENT); retry: for_each_btree_key_continue(iter, 0, k, ret) { if (bkey_cmp(prev.p, bkey_start_pos(k.k)) > 0) {