Thread (1 message) 1 message, 1 author, 2017-03-17

Re: [PATCH 1/2] super1: ignore failfast flag for setting device role

From: jes.sorensen@gmail.com
Date: 2017-03-17 20:21:37
Also in: lkml

Gioh Kim [off-list ref] writes:
quoted hunk
There is corner case for setting device role,
if new device has failfast flag.
The failfast flag should be ignored.

Signed-off-by: Gioh Kim <redacted>
Signed-off-by: Jack Wang <redacted>
---
 super1.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/super1.c b/super1.c
index 882cd61..1da33ef 100644
--- a/super1.c
+++ b/super1.c
@@ -1491,6 +1491,7 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
 	struct devinfo *di, **dip;
 	bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE);
 	int rv, lockid;
+	int dk_state;
 
 	if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) {
 		rv = cluster_get_dlmlock(&lockid);
@@ -1501,11 +1502,12 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
 		}
 	}
 
-	if ((dk->state & 6) == 6) /* active, sync */
+	dk_state &= ~(1<<MD_DISK_FAILFAST);
+	if ((dk_state & 6) == 6) /* active, sync */
 		*rp = __cpu_to_le16(dk->raid_disk);
This does not look right - you haven't assigned a value to dk_state, but
then start masking bits out of it.

Cheers,
Jes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help