aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-21 20:17:26 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:46 -0400
commit3d310eb7b3df1252e8595d059d982b0a9825a137 (patch)
tree9bca5e7eaa437d60010c1745b9aeb9592439d482 /include/linux
parent41158c7eb22312cfaa256744e1553bb4042ff085 (diff)
[PATCH] md: fix deadlock due to md thread processing delayed requests.
Before completing a 'write' the md superblock might need to be updated. This is best done by the md_thread. The current code schedules this up and queues the write request for later handling by the md_thread. However some personalities (Raid5/raid6) will deadlock if the md_thread tries to submit requests to its own array. So this patch changes things so the processes submitting the request waits for the superblock to be written and then submits the request itself. This fixes a recently-created deadlock in raid5/raid6 Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/raid/md.h2
-rw-r--r--include/linux/raid/md_k.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index cfde8f497d6d..75f41d8faed2 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -69,7 +69,7 @@ extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev),
69extern void md_unregister_thread (mdk_thread_t *thread); 69extern void md_unregister_thread (mdk_thread_t *thread);
70extern void md_wakeup_thread(mdk_thread_t *thread); 70extern void md_wakeup_thread(mdk_thread_t *thread);
71extern void md_check_recovery(mddev_t *mddev); 71extern void md_check_recovery(mddev_t *mddev);
72extern int md_write_start(mddev_t *mddev, struct bio *bi); 72extern void md_write_start(mddev_t *mddev, struct bio *bi);
73extern void md_write_end(mddev_t *mddev); 73extern void md_write_end(mddev_t *mddev);
74extern void md_handle_safemode(mddev_t *mddev); 74extern void md_handle_safemode(mddev_t *mddev);
75extern void md_done_sync(mddev_t *mddev, int blocks, int ok); 75extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 6cdcb4434c6c..3e977025cf43 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -261,7 +261,7 @@ struct mddev_s
261 sector_t recovery_cp; 261 sector_t recovery_cp;
262 262
263 spinlock_t write_lock; 263 spinlock_t write_lock;
264 struct bio_list write_list; 264 wait_queue_head_t sb_wait; /* for waiting on superblock updates */
265 265
266 unsigned int safemode; /* if set, update "clean" superblock 266 unsigned int safemode; /* if set, update "clean" superblock
267 * when no writes pending. 267 * when no writes pending.