• L
    md: fix io loss when remove rdev fail · f6175b41
    Li Nan 提交于
    hulk inclusion
    category: bugfix, https://gitee.com/openeuler/kernel/issues/I71EKW
    bugzilla: 188628
    CVE: NA
    
    --------------------------------
    
    We first set rdev to WantRemove, and check if there is any io
    pending, if so, we will clear flag and return busy in
    raid10_remove_disk(). io will loss as below:
    
      raid10_remove_disk
       set WantRemove
    			write rdev
    			 if WantRemove
    			  do not submit io
       if rdev->nr_pending
        clear WantRemove
        return BUSY
    					read rdev
    					 get error data
    
    Fix it by md_error the rdev which io pending while removing. When the code
    reaches this point, it means this rdev will be removed later, so setting
    it as faulty has little impact.
    Signed-off-by: NLi Nan <linan122@huawei.com>
    Reviewed-by: NYu Kuai <yukuai3@huawei.com>
    Reviewed-by: NHou Tao <houtao1@huawei.com>
    (cherry picked from commit 894f89fa)
    f6175b41
raid10.c 136.1 KB