mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luben Tuikov <luben@splentec.com>
To: LKML <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@suse.de>
Subject: [PATCH] fix kernel oops in generic_unplug_device() for md
Date: Tue, 11 Mar 2003 20:20:45 -0500	[thread overview]
Message-ID: <3E6E8B6D.1000501@splentec.com> (raw)

The following patch fixes a kernel oops when doing
blk_unplug_work() (oopses in generic_unplug_device()) for md.

The oops and the original report are here:
http://MARC.10East.com/?l=linux-kernel&m=104706400705154&w=2

The problem is that the md driver provides its own unplug
function (among other things) and blk_unplug_work() assumes
that the generic one would work, but it doesn't and BOOM,
it oopses and dies.

-- 
Luben

--- linux-2.5.64bk6/drivers/block/ll_rw_blk.c.orig	2003-03-11 16:23:55.000000000 -0500
+++ linux-2.5.64bk6/drivers/block/ll_rw_blk.c	2003-03-11 18:38:40.000000000 -0500
@@ -29,6 +29,7 @@

  static void blk_unplug_work(void *data);
  static void blk_unplug_timeout(unsigned long data);
+static int __make_request(request_queue_t *, struct bio *);

  /*
   * For the allocated request tables
@@ -1040,7 +1041,13 @@

  static void blk_unplug_work(void *data)
  {
-	generic_unplug_device(data);
+	request_queue_t *q = data;
+
+	if (q->make_request_fn && q->make_request_fn != __make_request
+	    && q->unplug_fn)
+		q->unplug_fn(data);
+	else
+		generic_unplug_device(data);
  }

  static void blk_unplug_timeout(unsigned long data)
@@ -1246,8 +1253,6 @@
  	return 1;
  }

-static int __make_request(request_queue_t *, struct bio *);
-
  /**
   * blk_init_queue  - prepare a request queue for use with a block device
   * @q:    The &request_queue_t to be initialised


             reply	other threads:[~2003-03-12  1:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-12  1:20 Luben Tuikov [this message]
2003-03-12  1:28 ` Andrew Morton
2003-03-12  7:11   ` 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=3E6E8B6D.1000501@splentec.com \
    --to=luben@splentec.com \
    --cc=axboe@suse.de \
    --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

all inboxes | Powered by JetHome®