All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] disk_free_ptbl_rcu_cb() crash
@ 2010-10-23 21:10 Eric Dumazet
  2010-10-24  6:04 ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2010-10-23 21:10 UTC (permalink / raw)
  To: Yasuaki Ishimatsu, Jens Axboe; +Cc: linux-kernel

Current Linus tree makes my machine crash in disk_free_ptbl_rcu_cb(),
while booting...

commit 7681bfeeccff5ef seems the problem ?

Following patch solves the NULL dereference, but this is only to show
you where the problem is, not a real fix, of course.

Thanks

 block/genhd.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index a8adf96..b63d401 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -930,14 +930,16 @@ static void disk_free_ptbl_rcu_cb(struct rcu_head *head)
 	struct disk_part_tbl *ptbl =
 		container_of(head, struct disk_part_tbl, rcu_head);
 	struct gendisk *disk = ptbl->disk;
-	struct request_queue *q = disk->queue;
+	struct request_queue *q = disk ? disk->queue : NULL;
 	unsigned long flags;
 
 	kfree(ptbl);
 
-	spin_lock_irqsave(q->queue_lock, flags);
-	elv_quiesce_end(q);
-	spin_unlock_irqrestore(q->queue_lock, flags);
+	if (q) {
+		spin_lock_irqsave(q->queue_lock, flags);
+		elv_quiesce_end(q);
+		spin_unlock_irqrestore(q->queue_lock, flags);
+	}
 }
 
 /**



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-24  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-23 21:10 [BUG] disk_free_ptbl_rcu_cb() crash Eric Dumazet
2010-10-24  6:04 ` Jens Axboe
2010-10-24  6:44   ` Eric Dumazet
2010-10-24  6:45     ` Jens Axboe
2010-10-24  6:52   ` Vivek Goyal
2010-10-24  7:00     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.