• NeilBrown's avatar
    [PATCH] md: Avoid a possibility that a read error can wrongly propagate... · 3fc9f598
    NeilBrown authored
    
    [PATCH] md: Avoid a possibility that a read error can wrongly propagate through md/raid1 to a filesystem.
    
    When a raid1 has only one working drive, we want read error to
    propagate up to the filesystem as there is no point failing the last
    drive in an array.
    
    Currently the code perform this check is racy.  If a write and a read
    a both submitted to a device on a 2-drive raid1, and the write fails
    followed by the read failing, the read will see that there is only one
    working drive and will pass the failure up, even though the one
    working drive is actually the *other* one.
    
    So, tighten up the locking.
    Signed-off-by: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
    3fc9f598
raid1.c 58.2 KB