From: Kent Overstreet Date: Sat, 18 Feb 2023 01:33:12 +0000 (-0500) Subject: bcachefs: Don't invalidate open buckets X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=84ddb8b98e674c0d052dd56a406efc5275c9508a;p=linux.git 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 --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index aefe72d34c5bb..472466d16b68a 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)