summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2015-12-07 17:08:39 -0800
committerNeilBrown <neilb@suse.com>2015-12-09 07:35:50 +1100
commitdbfbca430080de55ce70ba1fcdec44173a0ddc02 (patch)
treed73559c6df54301e4b5b272767d246a0d62968d7
parent198d54787c89872bc72d2824ba3c9d1a783e31ae (diff)
downloadmdadm-dbfbca430080de55ce70ba1fcdec44173a0ddc02.tar.gz
fix bug in assemble
In Assemble, getinfo_super() over-writes journal_clean. To ensure correct journal_clean, keep it in a local variable before getinfo_super(). Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
-rw-r--r--Assemble.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index 90c9918..a7cd163 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1302,6 +1302,7 @@ int Assemble(struct supertype *st, char *mddev,
int bestcnt = 0;
int devcnt;
unsigned int okcnt, sparecnt, rebuilding_cnt, replcnt, journalcnt;
+ int journal_clean = 0;
int i;
int was_forced = 0;
int most_recent = 0;
@@ -1592,7 +1593,7 @@ try_again:
) {
devices[j].uptodate = 1;
if (devices[j].i.disk.state & (1<<MD_DISK_JOURNAL))
- content->journal_clean = 1;
+ journal_clean = 1;
if (i < content->array.raid_disks * 2) {
if (devices[j].i.recovery_start == MaxSector ||
(content->reshape_active &&
@@ -1664,6 +1665,8 @@ try_again:
#ifndef MDASSEMBLE
sysfs_init(content, mdfd, NULL);
#endif
+ /* after reload context, store journal_clean in context */
+ content->journal_clean = journal_clean;
for (i=0; i<bestcnt; i++) {
int j = best[i];
unsigned int desired_state;