diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-06-21 20:17:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:43 -0400 |
commit | 06d91a5fe0b50c9060e70bdf7786f8a3c66249db (patch) | |
tree | 95a8b9228534cebb12eb31c1cc9cc0c45f685410 /include/linux/raid/md_k.h | |
parent | fca4d848f0e6fafdc2b25f8a0cf1e76935f13ac2 (diff) |
[PATCH] md: improve locking on 'safemode' and move superblock writes
When md marks the superblock dirty before a write, it calls
generic_make_request (to write the superblock) from within
generic_make_request (to write the first dirty block), which could cause
problems later.
With this patch, the superblock write is always done by the helper thread, and
write request are delayed until that write completes.
Also, the locking around marking the array dirty and writing the superblock is
improved to avoid possible races.
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/raid/md_k.h')
-rw-r--r-- | include/linux/raid/md_k.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9a0d4013be7..d92db54255a3 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -15,6 +15,9 @@ | |||
15 | #ifndef _MD_K_H | 15 | #ifndef _MD_K_H |
16 | #define _MD_K_H | 16 | #define _MD_K_H |
17 | 17 | ||
18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | ||
19 | #include "../../../drivers/md/dm-bio-list.h" | ||
20 | |||
18 | #define MD_RESERVED 0UL | 21 | #define MD_RESERVED 0UL |
19 | #define LINEAR 1UL | 22 | #define LINEAR 1UL |
20 | #define RAID0 2UL | 23 | #define RAID0 2UL |
@@ -252,6 +255,10 @@ struct mddev_s | |||
252 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 255 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
253 | wait_queue_head_t recovery_wait; | 256 | wait_queue_head_t recovery_wait; |
254 | sector_t recovery_cp; | 257 | sector_t recovery_cp; |
258 | |||
259 | spinlock_t write_lock; | ||
260 | struct bio_list write_list; | ||
261 | |||
255 | unsigned int safemode; /* if set, update "clean" superblock | 262 | unsigned int safemode; /* if set, update "clean" superblock |
256 | * when no writes pending. | 263 | * when no writes pending. |
257 | */ | 264 | */ |