diff options
| -rw-r--r-- | drivers/md/raid5-cache.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index aa990bde1fe2..de8a4ede0bc9 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c | |||
| @@ -2004,8 +2004,8 @@ static int r5c_recovery_flush_log(struct r5l_log *log, | |||
| 2004 | * happens again, new recovery will start from meta 1. Since meta 2n is | 2004 | * happens again, new recovery will start from meta 1. Since meta 2n is |
| 2005 | * valid now, recovery will think meta 3 is valid, which is wrong. | 2005 | * valid now, recovery will think meta 3 is valid, which is wrong. |
| 2006 | * The solution is we create a new meta in meta2 with its seq == meta | 2006 | * The solution is we create a new meta in meta2 with its seq == meta |
| 2007 | * 1's seq + 10 and let superblock points to meta2. The same recovery will | 2007 | * 1's seq + 10000 and let superblock points to meta2. The same recovery |
| 2008 | * not think meta 3 is a valid meta, because its seq doesn't match | 2008 | * will not think meta 3 is a valid meta, because its seq doesn't match |
| 2009 | */ | 2009 | */ |
| 2010 | 2010 | ||
| 2011 | /* | 2011 | /* |
| @@ -2035,7 +2035,7 @@ static int r5c_recovery_flush_log(struct r5l_log *log, | |||
| 2035 | * --------------------------------------------- | 2035 | * --------------------------------------------- |
| 2036 | * ^ ^ | 2036 | * ^ ^ |
| 2037 | * |- log->last_checkpoint |- ctx->pos+1 | 2037 | * |- log->last_checkpoint |- ctx->pos+1 |
| 2038 | * |- log->last_cp_seq |- ctx->seq+11 | 2038 | * |- log->last_cp_seq |- ctx->seq+10001 |
| 2039 | * | 2039 | * |
| 2040 | * However, it is not safe to start the state machine yet, because data only | 2040 | * However, it is not safe to start the state machine yet, because data only |
| 2041 | * parities are not yet secured in RAID. To save these data only parities, we | 2041 | * parities are not yet secured in RAID. To save these data only parities, we |
| @@ -2046,7 +2046,7 @@ static int r5c_recovery_flush_log(struct r5l_log *log, | |||
| 2046 | * ----------------------------------------------------------------- | 2046 | * ----------------------------------------------------------------- |
| 2047 | * ^ ^ | 2047 | * ^ ^ |
| 2048 | * |- log->last_checkpoint |- ctx->pos+n | 2048 | * |- log->last_checkpoint |- ctx->pos+n |
| 2049 | * |- log->last_cp_seq |- ctx->seq+10+n | 2049 | * |- log->last_cp_seq |- ctx->seq+10000+n |
| 2050 | * | 2050 | * |
| 2051 | * If failure happens again during this process, the recovery can safe start | 2051 | * If failure happens again during this process, the recovery can safe start |
| 2052 | * again from log->last_checkpoint. | 2052 | * again from log->last_checkpoint. |
| @@ -2058,7 +2058,7 @@ static int r5c_recovery_flush_log(struct r5l_log *log, | |||
| 2058 | * ----------------------------------------------------------------- | 2058 | * ----------------------------------------------------------------- |
| 2059 | * ^ ^ | 2059 | * ^ ^ |
| 2060 | * |- log->last_checkpoint |- ctx->pos+n | 2060 | * |- log->last_checkpoint |- ctx->pos+n |
| 2061 | * |- log->last_cp_seq |- ctx->seq+10+n | 2061 | * |- log->last_cp_seq |- ctx->seq+10000+n |
| 2062 | * | 2062 | * |
| 2063 | * Then we can safely start the state machine. If failure happens from this | 2063 | * Then we can safely start the state machine. If failure happens from this |
| 2064 | * point on, the recovery will start from new log->last_checkpoint. | 2064 | * point on, the recovery will start from new log->last_checkpoint. |
| @@ -2157,8 +2157,8 @@ static int r5l_recovery_log(struct r5l_log *log) | |||
| 2157 | if (ret) | 2157 | if (ret) |
| 2158 | return ret; | 2158 | return ret; |
| 2159 | 2159 | ||
| 2160 | pos = ctx.pos; | 2160 | pos = ctx.pos; |
| 2161 | ctx.seq += 10; | 2161 | ctx.seq += 10000; |
| 2162 | 2162 | ||
| 2163 | if (ctx.data_only_stripes == 0) { | 2163 | if (ctx.data_only_stripes == 0) { |
| 2164 | log->next_checkpoint = ctx.pos; | 2164 | log->next_checkpoint = ctx.pos; |
