diff options
author | NeilBrown <neilb@suse.de> | 2007-01-26 03:57:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-26 16:51:00 -0500 |
commit | 2a2275d630b982e5f90206f9bc497f6695a3ec5d (patch) | |
tree | 88cddee709b2107b74e5424810d4ffb6e3772382 /include | |
parent | a0ad13ef643a5829d63c456ab6143bbda60b44a9 (diff) |
[PATCH] md: fix potential memalloc deadlock in md
If a GFP_KERNEL allocation is attempted in md while the mddev_lock is held,
it is possible for a deadlock to eventuate.
This happens if the array was marked 'clean', and the memalloc triggers a
write-out to the md device.
For the writeout to succeed, the array must be marked 'dirty', and that
requires getting the mddev_lock.
So, before attempting a GFP_KERNEL allocation while holding the lock, make
sure the array is marked 'dirty' (unless it is currently read-only).
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/raid/md.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 866a1e2b0ce..fbaeda79b2e 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -94,7 +94,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | |||
94 | struct page *page, int rw); | 94 | struct page *page, int rw); |
95 | extern void md_do_sync(mddev_t *mddev); | 95 | extern void md_do_sync(mddev_t *mddev); |
96 | extern void md_new_event(mddev_t *mddev); | 96 | extern void md_new_event(mddev_t *mddev); |
97 | 97 | extern void md_allow_write(mddev_t *mddev); | |
98 | 98 | ||
99 | #endif /* CONFIG_MD */ | 99 | #endif /* CONFIG_MD */ |
100 | #endif | 100 | #endif |