Skip to content

Commit af140f8

Browse files
gouhao2025liu-song-6
authored andcommitted
md/raid1: remove unnecessary null checking
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
1 parent fa2bbff commit af140f8

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/md/raid1.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,6 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
11241124

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

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

0 commit comments

Comments
 (0)