Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Mike Snitzer <snitzer@redhat.com>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Pavel Begunkov <asml.silence@gmail.com>,
	drbd-dev@lists.linbit.com
Subject: [Drbd-dev] [PATCH 01/14] drbd: set ->bi_bdev in drbd_req_new
Date: Thu, 27 Jan 2022 07:35:33 +0100	[thread overview]
Message-ID: <20220127063546.1314111-2-hch@lst.de> (raw)
In-Reply-To: <20220127063546.1314111-1-hch@lst.de>

Make sure the newly allocated bio has the correct bi_bdev set from the
start.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/drbd/drbd_req.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3235532ae0778..8d44e96c4c4ef 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -31,6 +31,7 @@ static struct drbd_request *drbd_req_new(struct drbd_device *device, struct bio
 	memset(req, 0, sizeof(*req));
 
 	req->private_bio = bio_clone_fast(bio_src, GFP_NOIO, &drbd_io_bio_set);
+	bio_set_dev(req->private_bio, device->ldev->backing_bdev);
 	req->private_bio->bi_private = req;
 	req->private_bio->bi_end_io = drbd_request_endio;
 
@@ -1151,8 +1152,6 @@ drbd_submit_req_private_bio(struct drbd_request *req)
 	else
 		type = DRBD_FAULT_DT_RD;
 
-	bio_set_dev(bio, device->ldev->backing_bdev);
-
 	/* State may have changed since we grabbed our reference on the
 	 * ->ldev member. Double check, and short-circuit to endio.
 	 * In case the last activity log transaction failed to get on
-- 
2.30.2


  reply	other threads:[~2022-01-27  6:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  6:35 [Drbd-dev] improve the bio cloning interface Christoph Hellwig
2022-01-27  6:35 ` Christoph Hellwig [this message]
2022-01-27  6:35 ` [Drbd-dev] [PATCH 02/14] dm: add a clone_to_tio helper Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 03/14] dm: fold clone_bio into __clone_and_map_data_bio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 04/14] dm: fold __send_duplicate_bios into __clone_and_map_simple_bio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 05/14] dm: move cloning the bio into alloc_tio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 06/14] dm: pass the bio instead of tio to __map_bio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 07/14] dm: retun the clone bio from alloc_tio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 08/14] dm: simplify the single bio fast path in __send_duplicate_bios Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 09/14] dm: add a missing bio initialization to alloc_tio Christoph Hellwig
2022-01-29  5:06   ` [Drbd-dev] [dm] 3826813630: BUG:KASAN:double-free_or_invalid-free_in_dm_io_dec_pending kernel test robot
2022-01-27  6:35 ` [Drbd-dev] [PATCH 10/14] dm-cache: remove __remap_to_origin_clear_discard Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 11/14] block: clone crypto and integrity data in __bio_clone_fast Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 12/14] dm: use bio_clone_fast in alloc_tio Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 13/14] block: initialize the target bio in __bio_clone_fast Christoph Hellwig
2022-01-27  6:35 ` [Drbd-dev] [PATCH 14/14] block: pass a block_device to bio_clone_fast Christoph Hellwig
2022-01-27 16:52 ` [Drbd-dev] improve the bio cloning interface Mike Snitzer
2022-01-27 19:58   ` Christoph Hellwig

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=20220127063546.1314111-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    --cc=snitzer@redhat.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