• Neil Brown's avatar
    Close race in md_probe · a23a984f
    Neil Brown authored
    [ Upstream commit f48ed538 ]
    
    There is a possible race in md_probe.  If two threads call md_probe
    for the same device, then one could exit (having checked that
    ->gendisk exists) before the other has called kobject_init_and_add,
    thus returning an incomplete kobj which will cause problems when
    we try to add children to it.
    
    So extend the range of protection of disks_mutex slightly to
    avoid this possibility.
    Signed-off-by: default avatarNeil Brown <neilb@suse.de>
    CC: Oliver Pinter <oliver.pntr@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    a23a984f
md.c 155 KB