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: <3c8cc5d5-140e-3d9b-ea70-e1a3ce8513e4@linux.dev>
Date:   Wed, 27 Apr 2022 10:13:43 +0800
From:   Guoqing Jiang <guoqing.jiang@...ux.dev>
To:     Logan Gunthorpe <logang@...tatee.com>,
        linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
        Song Liu <song@...nel.org>
Cc:     Christoph Hellwig <hch@...radead.org>,
        Stephen Bates <sbates@...thlin.com>,
        Martin Oliveira <Martin.Oliveira@...eticom.com>,
        David Sloan <David.Sloan@...eticom.com>
Subject: Re: [PATCH v2 07/12] md/raid5: Move read_seqcount_begin() into
 make_stripe_request()



On 4/21/22 3:54 AM, Logan Gunthorpe wrote:
> Now that prepare_to_wait() isn't in the way, move read_sequcount_begin()
> into make_stripe_request().
>
> No functional changes intended.
>
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
> ---
>   drivers/md/raid5.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index b9f618356446..1bce9075e165 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -5804,13 +5804,15 @@ struct stripe_request_ctx {
>   
>   static enum stripe_result make_stripe_request(struct mddev *mddev,
>   		struct r5conf *conf, struct stripe_request_ctx *ctx,
> -		sector_t logical_sector, struct bio *bi, int seq)
> +		sector_t logical_sector, struct bio *bi)
>   {
>   	const int rw = bio_data_dir(bi);
>   	struct stripe_head *sh;
>   	sector_t new_sector;
>   	int previous = 0;
> -	int dd_idx;
> +	int seq, dd_idx;
> +
> +	seq = read_seqcount_begin(&conf->gen_lock);
>   
>   	if (unlikely(conf->reshape_progress != MaxSector)) {
>   		/* spinlock is needed as reshape_progress may be
> @@ -5970,13 +5972,9 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
>   	md_account_bio(mddev, &bi);
>   	prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
>   	for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) {
> -		int seq;
> -
>   	retry:
> -		seq = read_seqcount_begin(&conf->gen_lock);
> -
>   		res = make_stripe_request(mddev, conf, &ctx, logical_sector,
> -					  bi, seq);
> +					  bi);
>   		if (res == STRIPE_FAIL) {
>   			break;
>   		} else if (res == STRIPE_RETRY) {

Reviewed-by: Guoqing Jiang <guoqing.jiang@...ux.dev>

Thanks,
Guoqing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ