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: <20070801154904.GE13674@htj.dyndns.org>
Date:	Thu, 2 Aug 2007 00:49:04 +0900
From:	Tejun Heo <htejun@...il.com>
To:	NeilBrown <neilb@...e.de>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 008 of 35] Introduce bi_iocnt to count requests sharing the one bio.

Hello,

On Tue, Jul 31, 2007 at 12:16:29PM +1000, NeilBrown wrote:
>  static int ordered_bio_endio(struct request *rq, struct bio *bio,
>  			     int error)
>  {
>  	struct request_queue *q = rq->q;
> -	bio_end_io_t *endio;
> -	void *private;
>  
>  	if (&q->bar_rq != rq)
>  		return 0;
>  
>  	/*
>  	 * Okay, this is the barrier request in progress, dry finish it.
> +	 *
> +	 * We'll finish this request again with the original
> +	 * bi_end_io after an error occurs or post flush is complete.
>  	 */
> +
>  	if (error && !q->orderr)
>  		q->orderr = error;
>  
> -	endio = bio->bi_end_io;
> -	private = bio->bi_private;
> -	bio->bi_end_io = flush_dry_bio_endio;
> -	bio->bi_private = q;
> -
> -	bio_endio(bio, error);
> -
> -	bio->bi_end_io = endio;
> -	bio->bi_private = private;
> +	set_bit(BIO_UPTODATE, &bio->bi_flags);
>  
>  	return 1;
>  }

The only reason bio_endio() was called from ordered_bio_endio() was to
get the same side effect (bio update) as real io completions, which
should be reversed by flush_dry_bio_endio() to re-finish it later.
This was done this way under the assumption that somebody might depend
on bio updates after partial bio completion.

Now that it's guaranteed that there's no partial bio completion, none
of the dancing is needed.  Setting BIO_UPTODATE can be removed too.

Nice clean up.  Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ