mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] md/raid1: remove unnecessary null checking
@ 2023-12-14 15:14 Gou Hao
  2023-12-15 23:31 ` Song Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Gou Hao @ 2023-12-14 15:14 UTC (permalink / raw)
  To: song, linux-raid; +Cc: linux-kernel, gouhaojake

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>
---
 drivers/md/raid1.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 35d12948e0a9..e77dc95d4a75 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1126,8 +1126,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)) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] md/raid1: remove unnecessary null checking
  2023-12-14 15:14 [PATCH] md/raid1: remove unnecessary null checking Gou Hao
@ 2023-12-15 23:31 ` Song Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Song Liu @ 2023-12-15 23:31 UTC (permalink / raw)
  To: Gou Hao; +Cc: linux-raid, linux-kernel, gouhaojake

On Thu, Dec 14, 2023 at 7:15 AM Gou Hao <gouhao@uniontech.com> wrote:
>
> 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>

Applied to md-next. Thanks!

Song

> ---
>  drivers/md/raid1.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 35d12948e0a9..e77dc95d4a75 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -1126,8 +1126,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)) {
> --
> 2.34.1
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-15 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 15:14 [PATCH] md/raid1: remove unnecessary null checking Gou Hao
2023-12-15 23:31 ` Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®