• Song Liu's avatar
    md/raid5: use consistency_policy to remove journal feature · 0bb0c105
    Song Liu authored
    When journal device of an array fails, the array is forced into read-only
    mode. To make the array normal without adding another journal device, we
    need to remove journal _feature_ from the array.
    
    This patch allows remove journal _feature_ from an array, For journal
    existing journal should be either missing or faulty.
    
    To remove journal feature, it is necessary to remove the journal device
    first:
    
      mdadm --fail /dev/md0 /dev/sdb
      mdadm: set /dev/sdb faulty in /dev/md0
      mdadm --remove /dev/md0 /dev/sdb
      mdadm: hot removed /dev/sdb from /dev/md0
    
    Then the journal feature can be removed by echoing into the sysfs file:
    
     cat /sys/block/md0/md/consistency_policy
     journal
    
     echo resync > /sys/block/md0/md/consistency_policy
     cat /sys/block/md0/md/consistency_policy
     resync
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    0bb0c105
raid5.c 237 KB