• NeilBrown's avatar
    [PATCH] md: Fix badness in sysfs_notify caused by md_new_event · c331eb04
    NeilBrown authored
    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: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c331eb04
md.c 127 KB