diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2017-03-09 10:00:03 +0100 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-03-17 00:55:56 +0100 |
commit | ba903a3ea465bd2f2bb9316054b295e79a7a518e (patch) | |
tree | 9eae9199e526deaa23791d7477bffcd910dbe463 /drivers/md/raid5-ppl.c | |
parent | raid5-ppl: support disk hot add/remove with PPL (diff) | |
download | linux-ba903a3ea465bd2f2bb9316054b295e79a7a518e.tar.xz linux-ba903a3ea465bd2f2bb9316054b295e79a7a518e.zip |
raid5-ppl: runtime PPL enabling or disabling
Allow writing to 'consistency_policy' attribute when the array is
active. Add a new function 'change_consistency_policy' to the
md_personality operations structure to handle the change in the
personality code. Values "ppl" and "resync" are accepted and
turn PPL on and off respectively.
When enabling PPL its location and size should first be set using
'ppl_sector' and 'ppl_size' attributes and a valid PPL header should be
written at this location on each member device.
Enabling or disabling PPL is performed under a suspended array. The
raid5_reset_stripe_cache function frees the stripe cache and allocates
it again in order to allocate or free the ppl_pages for the stripes in
the stripe cache.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5-ppl.c')
-rw-r--r-- | drivers/md/raid5-ppl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 4af420f4d8c0..27bad3e2d7ce 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -1187,6 +1187,10 @@ int ppl_init_log(struct r5conf *conf) */ mddev->recovery_cp = MaxSector; set_bit(MD_SB_CHANGE_CLEAN, &mddev->sb_flags); + } else if (mddev->pers && ppl_conf->mismatch_count > 0) { + /* no mismatch allowed when enabling PPL for a running array */ + ret = -EINVAL; + goto err; } conf->log_private = ppl_conf; |