summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-01-04 16:10:19 -0800
committerShaohua Li <shli@fb.com>2017-01-05 11:45:18 -0800
commit394ed8e4743b0cfc5496fe49059fbfc2bc8eae35 (patch)
tree65412c7b017be0fc1a2316f4a0778328421a0f4c /drivers/md/raid5.c
parent99f17890f04cff0262de7393c60a2f6d9c9c7e71 (diff)
md: cleanup mddev flag clear for takeover
Commit 6995f0b (md: takeover should clear unrelated bits) clear unrelated bits, but it's quite fragile. To avoid error in the future, define a macro for unsupported mddev flags for each raid type and use it to clear unsupported mddev flags. This should be less error-prone. Suggested-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 06d7279bdd04..7b1da6e95a56 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -62,6 +62,8 @@
#include "raid0.h"
#include "bitmap.h"
+#define UNSUPPORTED_MDDEV_FLAGS (1L << MD_FAILFAST_SUPPORTED)
+
#define cpu_to_group(cpu) cpu_to_node(cpu)
#define ANY_GROUP NUMA_NO_NODE
@@ -7830,7 +7832,8 @@ static void *raid5_takeover_raid1(struct mddev *mddev)
ret = setup_conf(mddev);
if (!IS_ERR_VALUE(ret))
- clear_bit(MD_FAILFAST_SUPPORTED, &mddev->flags);
+ mddev_clear_unsupported_flags(mddev,
+ UNSUPPORTED_MDDEV_FLAGS);
return ret;
}