public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Yan <tom.ty89@gmail.com>
To: linux-block@vger.kernel.org, hch@lst.de, ming.l@ssi.samsung.com,
	sagig@grimberg.me, axboe@fb.com
Cc: tom.leiming@gmail.com, Tom Yan <tom.ty89@gmail.com>
Subject: [PATCH] block: fix bio chaining in blk_next_bio()
Date: Sun,  6 Dec 2020 13:18:02 +0800	[thread overview]
Message-ID: <20201206051802.1890-1-tom.ty89@gmail.com> (raw)

While it seems to have worked for so long, it doesn't seem right
that we set the new bio as the parent. bio_chain() seems to be used
in the other way everywhere else anyway.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
---
 block/blk-lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index e90614fd8d6a..918deaf5c8a4 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -15,7 +15,7 @@ struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)
 	struct bio *new = bio_alloc(gfp, nr_pages);
 
 	if (bio) {
-		bio_chain(bio, new);
+		bio_chain(new, bio);
 		submit_bio(bio);
 	}
 
-- 
2.29.2


             reply	other threads:[~2020-12-06  5:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  5:18 Tom Yan [this message]
2020-12-06 11:20 ` [PATCH] block: fix bio chaining in blk_next_bio() Hannes Reinecke
2020-12-06 13:17   ` Tom Yan
2020-12-06 14:17     ` Tom Yan
2020-12-07  3:12 ` Ming Lei
2020-12-08 12:46   ` Tom Yan
2020-12-09  1:20     ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201206051802.1890-1-tom.ty89@gmail.com \
    --to=tom.ty89@gmail.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.l@ssi.samsung.com \
    --cc=sagig@grimberg.me \
    --cc=tom.leiming@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox