summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-18 04:33:12 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:53 +0300
commit84ddb8b98e674c0d052dd56a406efc5275c9508a (patch)
tree87b8e4869531c9e371d9c76b10b1cc4b679fc8a7 /fs/bcachefs/alloc_background.c
parent80c33085783656617d0d07e1bc9fba70a592ce5c (diff)
downloadlinux-84ddb8b98e674c0d052dd56a406efc5275c9508a.tar.xz
bcachefs: Don't invalidate open buckets
Like bch2_trans_mark_bucket(), we shouldn't be incrementing a bucket gen while it's still open - erasure coding was hitting this. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r--fs/bcachefs/alloc_background.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index aefe72d34c5b..472466d16b68 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1785,6 +1785,9 @@ static int invalidate_one_bucket(struct btree_trans *trans,
goto err;
}
+ if (bch2_bucket_is_open_safe(c, bucket.inode, bucket.offset))
+ return 0;
+
a = bch2_trans_start_alloc_update(trans, &alloc_iter, bucket);
ret = PTR_ERR_OR_ZERO(a);
if (ret)