bcachefs: Fix for bch2_copygc() spuriously returning -EEXIST
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 4 Aug 2023 14:51:02 +0000 (10:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:09 +0000 (17:10 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/movinggc.c

index 5242f20bb680fc2c0d9fc8ebd54188db87dfa8ab..256431a6dc0caf502b11808877b625848048ad75 100644 (file)
@@ -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;