]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/ec.c
Update bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()
[bcachefs-tools-debian] / libbcachefs / ec.c
index 439fa540323f472f63ebc854a52bdc07ff3b850b..dfc0a61afa511d4f8d27ef9b3c46bd2f6ae14dfe 100644 (file)
@@ -485,7 +485,7 @@ int bch2_ec_read_extent(struct bch_fs *c, struct bch_read_bio *rbio)
 
        BUG_ON(!rbio->pick.has_ec);
 
-       buf = kzalloc(sizeof(*buf), GFP_NOIO);
+       buf = kzalloc(sizeof(*buf), GFP_NOFS);
        if (!buf)
                return -BCH_ERR_ENOMEM_ec_read_extent;
 
@@ -578,15 +578,8 @@ static int __ec_stripe_mem_alloc(struct bch_fs *c, size_t idx, gfp_t gfp)
 static int ec_stripe_mem_alloc(struct btree_trans *trans,
                               struct btree_iter *iter)
 {
-       size_t idx = iter->pos.offset;
-
-       if (!__ec_stripe_mem_alloc(trans->c, idx, GFP_NOWAIT|__GFP_NOWARN))
-               return 0;
-
-       bch2_trans_unlock(trans);
-
-       return   __ec_stripe_mem_alloc(trans->c, idx, GFP_KERNEL) ?:
-               bch2_trans_relock(trans);
+       return allocate_dropping_locks_errcode(trans,
+                       __ec_stripe_mem_alloc(trans->c, iter->pos.offset, _gfp));
 }
 
 /*