Skip to content

Commit

Permalink
dm raid1: remove impossible mempool_alloc error test
Browse files Browse the repository at this point in the history
mempool_alloc can't fail if __GFP_WAIT is specified, so the condition
that tests if read_record is non-NULL is always true.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 21, 2012
1 parent 018debe commit 7c27213
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,11 +1195,9 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
return -EIO;

read_record = mempool_alloc(ms->read_record_pool, GFP_NOIO);
if (likely(read_record)) {
dm_bio_record(&read_record->details, bio);
map_context->ptr = read_record;
read_record->m = m;
}
dm_bio_record(&read_record->details, bio);
map_context->ptr = read_record;
read_record->m = m;

map_bio(m, bio);

Expand Down

0 comments on commit 7c27213

Please sign in to comment.