]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] md: Fix badness in sysfs_notify caused by md_new_event
authorNeilBrown <neilb@suse.de>
Wed, 31 May 2006 04:27:13 +0000 (21:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 31 May 2006 23:27:11 +0000 (16:27 -0700)
commit490153a0704ed0b16f66035d804b1b5bc8c0b3b1
treed3ef167648eb00266696039cc10b32592747e5fe
parentf6889cbc01c66ef4eb4a2877cd56d5f1b7ad65e3
[PATCH] md: Fix badness in sysfs_notify caused by md_new_event

From: NeilBrown <neilb@suse.de>

If an error is reported by a drive in a RAID array (which is done via
bi_end_io - in interrupt context), we call md_error and md_new_event which
calls sysfs_notify.  However sysfs_notify grabs a mutex and so cannot be
called in interrupt context.

This patch just creates a variant of md_new_event which avoids the sysfs
call, and uses that.  A better fix for later is to arrange for the event to
be called from user-context.

Note: avoiding the sysfs call isn't a problem as an error will not, by
itself, modify the sync_action attribute.  (We do still need to
wake_up(&md_event_waiters) as an error by itself will modify /proc/mdstat).

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c