diff options
Diffstat (limited to 'libbcachefs/ec.c')
-rw-r--r-- | libbcachefs/ec.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libbcachefs/ec.c b/libbcachefs/ec.c index 439fa540..dfc0a61a 100644 --- a/libbcachefs/ec.c +++ b/libbcachefs/ec.c @@ -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)); } /* |