OSDN Git Service

md/raid5: use consistency_policy to remove journal feature
authorSong Liu <songliubraving@fb.com>
Mon, 27 Mar 2017 17:51:33 +0000 (10:51 -0700)
committerShaohua Li <shli@fb.com>
Mon, 27 Mar 2017 19:02:33 +0000 (12:02 -0700)
commit0bb0c10500ba634216238c40e1eeddce92b4d488
treef7bca55d0d048f27362a6d65a2ef3be6eb70b1e6
parent1ad45a9bc4e0cd5a6e6fb0e6c5d35d6c87f14c76
md/raid5: use consistency_policy to remove journal feature

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: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5.c