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: <20090511090629.GO4694@kernel.dk>
Date:	Mon, 11 May 2009 11:06:30 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Cc:	tj@...nel.org, James.Bottomley@...senPartnership.com,
	bharrosh@...asas.com, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] block: let blk_end_request_all handle bidi requests

On Mon, May 11 2009, FUJITA Tomonori wrote:
> blk_end_request_all() and __blk_end_request_all() should finish all
> bytes including bidi, by definition. That's what all bidi users need ,
> bidi requests must be complete as a whole (partial completion is
> impossible).
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
> ---
>  include/linux/blkdev.h |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 8919683..3b5c564 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -911,8 +911,12 @@ static inline bool blk_end_request(struct request *rq, int error,
>  static inline void blk_end_request_all(struct request *rq, int error)
>  {
>  	bool pending;
> +	unsigned int bidi_bytes = 0;
>  
> -	pending = blk_end_request(rq, error, blk_rq_bytes(rq));
> +	if (unlikely(blk_bidi_rq(rq)))
> +		bidi_bytes = blk_rq_bytes(rq->next_rq);
> +
> +	pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
>  	BUG_ON(pending);
>  }
>  
> @@ -963,8 +967,12 @@ static inline bool __blk_end_request(struct request *rq, int error,
>  static inline void __blk_end_request_all(struct request *rq, int error)
>  {
>  	bool pending;
> +	unsigned int bidi_bytes = 0;
> +
> +	if (unlikely(blk_bidi_rq(rq)))
> +		bidi_bytes = blk_rq_bytes(rq->next_rq);
>  
> -	pending = __blk_end_request(rq, error, blk_rq_bytes(rq));
> +	pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
>  	BUG_ON(pending);
>  }

Looks ok, perhaps we can next get rid of the bidi naming? It's all
pretty much folded into one anyway, using __blk_end_bidi_request() from
generic end-request handling looks confusing.

-- 
Jens Axboe

--
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