Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lightnvm: don't check for failure from mempool_alloc()

mempool_alloc() cannot fail if the gfp flags allow it to
sleep, and both GFP_KERNEL and GFP_NOIO allows for sleeping.

So rrpc_move_valid_pages() and rrpc_make_rq() don't need to
test the return value.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>

authored by

NeilBrown and committed by
Jens Axboe
b0e0306c 48d663a3

-9
-9
drivers/lightnvm/rrpc.c
··· 318 318 } 319 319 320 320 page = mempool_alloc(rrpc->page_pool, GFP_NOIO); 321 - if (!page) { 322 - bio_put(bio); 323 - return -ENOMEM; 324 - } 325 321 326 322 while ((slot = find_first_zero_bit(rblk->invalid_pages, 327 323 nr_sec_per_blk)) < nr_sec_per_blk) { ··· 1002 1006 } 1003 1007 1004 1008 rqd = mempool_alloc(rrpc->rq_pool, GFP_KERNEL); 1005 - if (!rqd) { 1006 - pr_err_ratelimited("rrpc: not able to queue bio."); 1007 - bio_io_error(bio); 1008 - return BLK_QC_T_NONE; 1009 - } 1010 1009 memset(rqd, 0, sizeof(struct nvm_rq)); 1011 1010 1012 1011 err = rrpc_submit_io(rrpc, bio, rqd, NVM_IOTYPE_NONE);