From: Kent Overstreet Date: Fri, 4 Aug 2023 14:51:02 +0000 (-0400) Subject: bcachefs: Fix for bch2_copygc() spuriously returning -EEXIST X-Git-Tag: io_uring-6.7-2023-11-10~119^2~145 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f6e6f42bbbe5e421b57182bb0c92a237701ca889;p=linux-block.git bcachefs: Fix for bch2_copygc() spuriously returning -EEXIST Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index 5242f20bb680..256431a6dc0c 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -220,8 +220,10 @@ static int bch2_copygc(struct btree_trans *trans, f = move_bucket_in_flight_add(buckets_in_flight, *i); ret = PTR_ERR_OR_ZERO(f); - if (ret == -EEXIST) /* rare race: copygc_get_buckets returned same bucket more than once */ + if (ret == -EEXIST) { /* rare race: copygc_get_buckets returned same bucket more than once */ + ret = 0; continue; + } if (ret == -ENOMEM) { /* flush IO, continue later */ ret = 0; break;