public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Markus <M4rkusXXL@web.de>
Cc: lkml <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>
Subject: Re: hybrid raid1 with trim support [REGRESSION]
Date: Sun, 28 Apr 2013 09:00:16 +0800	[thread overview]
Message-ID: <20130428010016.GA26411@kernel.org> (raw)
In-Reply-To: <20130428005446.GA20018@kernel.org>

On Sun, Apr 28, 2013 at 08:54:46AM +0800, Shaohua Li wrote:
> On Sat, Apr 27, 2013 at 06:29:49PM +0200, Markus wrote:
> > Hi!
> > 
> > Now I had the time to bisect, started with 3.7 as good and 3.8 as bad.
> > 0cfbcafcae8b7364b5fa96c2b26ccde7a3a296a9 is the bad commit. [1]
> > block: add plug for blkdev_issue_discard
> > 
> > While 3.8.10 was still bad, the same kernel with the reverted patch applied is fine.
> Thanks for the reporting. Does below patch work for you?
Oops, there is a typo there, should be this one:

---
 drivers/md/raid1.c  |    7 ++++++-
 drivers/md/raid10.c |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

Index: linux/drivers/md/raid1.c
===================================================================
--- linux.orig/drivers/md/raid1.c	2013-03-07 14:14:05.950824173 +0800
+++ linux/drivers/md/raid1.c	2013-04-28 08:57:17.874058434 +0800
@@ -981,7 +981,12 @@ static void raid1_unplug(struct blk_plug
 	while (bio) { /* submit pending writes */
 		struct bio *next = bio->bi_next;
 		bio->bi_next = NULL;
-		generic_make_request(bio);
+		if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+		    !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
+			/* Just ignore it */
+			bio_endio(bio, 0);
+		else
+			generic_make_request(bio);
 		bio = next;
 	}
 	kfree(plug);
Index: linux/drivers/md/raid10.c
===================================================================
--- linux.orig/drivers/md/raid10.c	2013-03-07 14:14:05.950824173 +0800
+++ linux/drivers/md/raid10.c	2013-04-28 08:57:44.765719067 +0800
@@ -1133,7 +1133,12 @@ static void raid10_unplug(struct blk_plu
 	while (bio) { /* submit pending writes */
 		struct bio *next = bio->bi_next;
 		bio->bi_next = NULL;
-		generic_make_request(bio);
+		if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+		    !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
+			/* Just ignore it */
+			bio_endio(bio, 0);
+		else
+			generic_make_request(bio);
 		bio = next;
 	}
 	kfree(plug);

  reply	other threads:[~2013-04-28  1:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 17:49 hybrid raid1 with trim support Markus
2013-03-24  9:21 ` Markus
2013-04-27 16:29   ` hybrid raid1 with trim support [REGRESSION] Markus
2013-04-28  0:54     ` Shaohua Li
2013-04-28  1:00       ` Shaohua Li [this message]
2013-04-28  9:40         ` Markus
2013-04-28 10:10           ` Shaohua Li

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=20130428010016.GA26411@kernel.org \
    --to=shli@kernel.org \
    --cc=M4rkusXXL@web.de \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@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