• A
    btrfs: check generation as replace duplicates devid+uuid · 77bdae4d
    Anand Jain 提交于
    When FS in unmounted we need to check generation number as well
    since devid+uuid combination could match with the missing replaced
    disk when it reappears, and without this patch it might pair with
    the replaced disk again.
    
     device_list_add() function is called in the following threads,
    	mount device option
    	mount argument
    	ioctl BTRFS_IOC_SCAN_DEV (btrfs dev scan)
    	ioctl BTRFS_IOC_DEVICES_READY (btrfs dev ready <dev>)
     they have been unit tested to work fine with this patch.
    
     If the user knows what he is doing and really want to pair with
     replaced disk (which is not a standard operation), then he should
     first clear the kernel btrfs device list in the memory by doing
     the module unload/load and followed with the mount -o device option.
    Signed-off-by: NAnand Jain <anand.jain@oracle.com>
    Signed-off-by: NWang Shilong <wangsl.fnst@cn.fujitsu.com>
    Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
    Signed-off-by: NChris Mason <clm@fb.com>
    77bdae4d
volumes.c 165.5 KB