Skip to content

Commit

Permalink
md/raid1: remove unnecessary null checking
Browse files Browse the repository at this point in the history
If %__GFP_DIRECT_RECLAIM is set then bio_alloc_bioset will always
be able to allocate a bio. See comment of bio_alloc_bioset.

Signed-off-by: Gou Hao <gouhao@uniontech.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231214151458.28970-1-gouhao@uniontech.com
  • Loading branch information
Gou Hao authored and Song Liu committed Dec 15, 2023
1 parent fa2bbff commit af140f8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,6 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,

behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO,
&r1_bio->mddev->bio_set);
if (!behind_bio)
return;

/* discard op, we don't support writezero/writesame yet */
if (!bio_has_data(bio)) {
Expand Down

0 comments on commit af140f8

Please sign in to comment.