lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1ae55b7f-fd28-4994-8fa5-956864c40139@fnnas.com>
Date: Thu, 5 Feb 2026 00:59:12 +0800
From: "Yu Kuai" <yukuai@...as.com>
To: <linan666@...weicloud.com>, <song@...nel.org>
Cc: <xni@...hat.com>, <linux-raid@...r.kernel.org>, 
	<linux-kernel@...r.kernel.org>, <yangerkun@...wei.com>, 
	<yi.zhang@...wei.com>, <yukuai@...as.com>
Subject: Re: [PATCH v2 11/14] md: clean up resync_free_folio

Hi,

在 2026/1/28 15:57, linan666@...weicloud.com 写道:
> From: Li Nan <linan122@...wei.com>
>
> The resync_free_folio() helper only wraps a single folio_put() call,
> so remove it and call folio_put() directly.
>
> Signed-off-by: Li Nan <linan122@...wei.com>
> ---
>   drivers/md/raid1-10.c | 5 -----
>   drivers/md/raid1.c    | 4 ++--
>   drivers/md/raid10.c   | 4 ++--
>   3 files changed, 4 insertions(+), 9 deletions(-)

Same as patch 10, I think this patch should be merged into patch 5.

>
> diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
> index 2ff1f8855900..ffbd7bd0f6e8 100644
> --- a/drivers/md/raid1-10.c
> +++ b/drivers/md/raid1-10.c
> @@ -50,11 +50,6 @@ static inline int resync_alloc_folio(struct resync_folio *rf,
>   	return 0;
>   }
>   
> -static inline void resync_free_folio(struct resync_folio *rf)
> -{
> -	folio_put(rf->folio);
> -}
> -
>   /*
>    * 'strct resync_folio' stores actual pages used for doing the resync
>    *  IO, and it is per-bio, so make .bi_private points to it.
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index a303349eeff4..b5239b5cb4e9 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -199,7 +199,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
>   
>   out_free_folio:
>   	while (--j >= 0)
> -		resync_free_folio(&rfs[j]);
> +		folio_put(rfs[j].folio);
>   
>   out_free_bio:
>   	while (++j < conf->raid_disks * 2) {
> @@ -222,7 +222,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data)
>   
>   	for (i = conf->raid_disks * 2; i--; ) {
>   		rf = get_resync_folio(r1bio->bios[i]);
> -		resync_free_folio(rf);
> +		folio_put(rf->folio);
>   		bio_uninit(r1bio->bios[i]);
>   		kfree(r1bio->bios[i]);
>   	}
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index d8a5fadfc933..b728131bdad4 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -204,7 +204,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
>   
>   out_free_folio:
>   	while (--j >= 0)
> -		resync_free_folio(&rfs[j]);
> +		folio_put(rfs[j].folio);
>   
>   	j = 0;
>   out_free_bio:
> @@ -234,7 +234,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data)
>   
>   		if (bio) {
>   			rf = get_resync_folio(bio);
> -			resync_free_folio(rf);
> +			folio_put(rf->folio);
>   			bio_uninit(bio);
>   			kfree(bio);
>   		}

-- 
Thansk,
Kuai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ