From: NeilBrown <neilb@suse.de>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-raid@vger.kernel.org, dm-devel@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] block: remove support for bio remapping from ->make_request
Date: Mon, 12 Sep 2011 05:25:08 +0200 [thread overview]
Message-ID: <20110912052508.6b59b5ac@notabene.brown> (raw)
In-Reply-To: <20110911145129.GA29504@infradead.org>
On Sun, 11 Sep 2011 10:51:29 -0400 Christoph Hellwig <hch@infradead.org>
wrote:
> There is very little benefit in allowing to let a ->make_request instance update
> the bios device and sector and loop around it in __generic_make_request when
> we can archive the same through calling generic_make_request from the driver
> and letting the loop in generic_make_request handle it.
Completely agree - I like this change!
>
> Note that various drivers got the return value from ->make_request and returned
> non-zero values for errors.
:-(
A diff-stat would have been nice... I think I've found all 'my' files though.
> Index: linux-2.6/drivers/md/faulty.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/faulty.c 2011-09-08 12:01:53.000000000 +0200
> +++ linux-2.6/drivers/md/faulty.c 2011-09-08 12:05:58.602773802 +0200
> @@ -169,7 +169,7 @@ static void add_sector(conf_t *conf, sec
> conf->nfaults = n+1;
> }
>
> -static int make_request(mddev_t *mddev, struct bio *bio)
> +static void make_request(mddev_t *mddev, struct bio *bio)
> {
> conf_t *conf = mddev->private;
> int failit = 0;
> @@ -181,7 +181,7 @@ static int make_request(mddev_t *mddev,
> * just fail immediately
> */
> bio_endio(bio, -EIO);
> - return 0;
> + return;
> }
>
> if (check_sector(conf, bio->bi_sector, bio->bi_sector+(bio->bi_size>>9),
> @@ -214,12 +214,11 @@ static int make_request(mddev_t *mddev,
> b->bi_bdev = conf->rdev->bdev;
> b->bi_private = bio;
> b->bi_end_io = faulty_fail;
> - generic_make_request(b);
> - return 0;
> } else {
> bio->bi_bdev = conf->rdev->bdev;
> - return 1;
> }
> +
> + generic_make_request(b);
> }
If the 'else' branch was taken, we need to generic_make_request(bio).
And 'b' isn't even declared at this level.
So at the end of the 'then' branch, add
bio = b;
and make the final call
generic_make_request(bio);
Changes to these files:
> Index: linux-2.6/drivers/md/linear.c
> Index: linux-2.6/drivers/md/multipath.c
> Index: linux-2.6/drivers/md/raid0.c
> Index: linux-2.6/drivers/md/raid1.c
> Index: linux-2.6/drivers/md/raid10.c
> Index: linux-2.6/drivers/md/raid5.c
> Index: linux-2.6/drivers/md/md.h
> Index: linux-2.6/drivers/md/md.c
Acked-by: NeilBrown <neilb@suse.de>
Thanks,
NeilBrown
next prev parent reply other threads:[~2011-09-12 3:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-11 14:50 [PATCH 1/2] block: export __make_request Christoph Hellwig
2011-09-11 14:51 ` [PATCH 2/2] block: remove support for bio remapping from ->make_request Christoph Hellwig
2011-09-12 3:25 ` NeilBrown [this message]
2011-09-12 9:59 ` Jens Axboe
2011-09-12 12:25 ` Christoph Hellwig
2011-09-12 12:26 ` Jens Axboe
2011-09-12 9:59 ` [PATCH 1/2] block: export __make_request Jens Axboe
2011-09-12 12:25 ` Christoph Hellwig
2011-09-12 12:26 ` Jens Axboe
2011-09-12 13:38 ` Christoph Hellwig
2011-09-12 18:04 ` Jens Axboe
2011-09-13 21:19 ` Christoph Hellwig
2011-09-14 17:17 ` Boaz Harrosh
2011-09-14 17:53 ` Doug Dumitru
2011-09-14 18:40 ` Alan Cox
2011-09-14 21:34 ` Doug Dumitru
2011-09-14 22:01 ` Alan Cox
2011-09-14 22:48 ` Doug Dumitru
2011-09-15 10:20 ` Bernd Petrovitsch
2011-09-14 20:16 ` Nicholas A. Bellinger
2011-09-12 13:42 ` [PATCH 3/2] block: refactor generic_make_request Christoph Hellwig
2011-09-12 15:09 ` Vivek Goyal
2011-09-12 15:13 ` Christoph Hellwig
2011-09-15 11:55 ` Christoph Hellwig
2011-09-15 11:56 ` Jens Axboe
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=20110912052508.6b59b5ac@notabene.brown \
--to=neilb@suse.de \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).