summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2015-12-15 02:43:43 +0100
committerNeilBrown <neilb@suse.com>2015-12-16 02:43:56 +0100
commit01290056d01941c9443dddc33768055bd3ed5a73 (patch)
treed06c2c0b5c204b83068f69b618b49904e97b93fd /super1.c
parentadd sysfs_array_state to struct mdinfo (diff)
downloadmdadm-01290056d01941c9443dddc33768055bd3ed5a73.tar.xz
mdadm-01290056d01941c9443dddc33768055bd3ed5a73.zip
recreate journal in mdadm
This patch tries recreates missing/faulty journal in mdadm. Example: ./mdadm --fail /dev/md1 /dev/sdb2 mdadm: set /dev/sdb2 faulty in /dev/md1 ./mdadm --stop /dev/md1 mdadm: stopped /dev/md1 ./mdadm -A --scan --force mdadm: Journal is missing or stale, starting array read only. mdadm: /dev/md/1 has been started with 15 drives. ./mdadm --add-journal /dev/md1 /dev/sdb2 mdadm: added /dev/sdb2 Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index 1735c2d7..893f9bf6 100644
--- a/super1.c
+++ b/super1.c
@@ -1713,7 +1713,8 @@ static int write_init_super1(struct supertype *st)
if (rfd >= 0)
close(rfd);
- sb->events = 0;
+ if (!(di->disk.state & (1<<MD_DISK_JOURNAL)))
+ sb->events = 0;
refst = dup_super(st);
if (load_super1(refst, di->fd, NULL)==0) {