All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bio: Make the test correct for idx in __bio_clone_fast
@ 2015-12-18 17:09 Minfei Huang
  2016-01-18 13:00 ` Minfei Huang
  0 siblings, 1 reply; 2+ messages in thread
From: Minfei Huang @ 2015-12-18 17:09 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, mhuang, Minfei Huang

It is more lucky that kernel crash does not happen, since we test the
bi_pool in function __bio_clone_fast.

The idx will be still equal to BIO_POOL_NONE, if there is no bvec to be
allocated.

Fix the bug_on condition to make the test correct.

Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
 block/bio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 4f184d9..041ece0 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -573,8 +573,7 @@ EXPORT_SYMBOL(bio_phys_segments);
  */
 void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
 {
-	BUG_ON(bio->bi_pool && BIO_POOL_IDX(bio) != BIO_POOL_NONE);
-
+	BUG_ON(BIO_POOL_IDX(bio) != BIO_POOL_NONE);
 	/*
 	 * most users will be overriding ->bi_bdev with a new target,
 	 * so we don't set nor calculate new physical/hw segment counts here
-- 
2.6.3


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

* Re: [PATCH] bio: Make the test correct for idx in __bio_clone_fast
  2015-12-18 17:09 [PATCH] bio: Make the test correct for idx in __bio_clone_fast Minfei Huang
@ 2016-01-18 13:00 ` Minfei Huang
  0 siblings, 0 replies; 2+ messages in thread
From: Minfei Huang @ 2016-01-18 13:00 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, mhuang

Ping.
Any comment is appreciate.

Thanks
Minfei

On 12/19/15 at 01:09P, Minfei Huang wrote:
> It is more lucky that kernel crash does not happen, since we test the
> bi_pool in function __bio_clone_fast.
> 
> The idx will be still equal to BIO_POOL_NONE, if there is no bvec to be
> allocated.
> 
> Fix the bug_on condition to make the test correct.
> 
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
>  block/bio.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block/bio.c b/block/bio.c
> index 4f184d9..041ece0 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -573,8 +573,7 @@ EXPORT_SYMBOL(bio_phys_segments);
>   */
>  void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
>  {
> -	BUG_ON(bio->bi_pool && BIO_POOL_IDX(bio) != BIO_POOL_NONE);
> -
> +	BUG_ON(BIO_POOL_IDX(bio) != BIO_POOL_NONE);
>  	/*
>  	 * most users will be overriding ->bi_bdev with a new target,
>  	 * so we don't set nor calculate new physical/hw segment counts here
> -- 
> 2.6.3
> 

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

end of thread, other threads:[~2016-01-18 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18 17:09 [PATCH] bio: Make the test correct for idx in __bio_clone_fast Minfei Huang
2016-01-18 13:00 ` Minfei Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.