dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-r5cache-allow-adding-journal-to-array-without-.patch

2c1b57
From 3373d49f32b2bd8149f633727eba453708a9bf9c Mon Sep 17 00:00:00 2001
2c1b57
From: Song Liu <songliubraving@fb.com>
2c1b57
Date: Tue, 28 Mar 2017 11:04:44 -0700
2c1b57
Subject: [RHEL7.5 PATCH 160/169] mdadm/r5cache: allow adding journal to
2c1b57
 array without journal
2c1b57
2c1b57
Currently, --add-journal can be only used to recreate broken journal
2c1b57
for arrays with journal since  creation. As the kernel code getting
2c1b57
more mature, this constraint is no longer necessary.
2c1b57
2c1b57
This patch allows --add-journal to add journal to array without
2c1b57
journal.
2c1b57
2c1b57
Signed-off-by: Song Liu <songliubraving@fb.com>
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Manage.c   | 6 ------
2c1b57
 mdadm.8.in | 5 ++---
2c1b57
 2 files changed, 2 insertions(+), 9 deletions(-)
2c1b57
2c1b57
diff --git a/Manage.c b/Manage.c
2c1b57
index 04b9398..b82a729 100644
2c1b57
--- a/Manage.c
2c1b57
+++ b/Manage.c
2c1b57
@@ -911,7 +911,6 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
2c1b57
 
2c1b57
 	/* only add journal to array that supports journaling */
2c1b57
 	if (dv->disposition == 'j') {
2c1b57
-		struct mdinfo mdi;
2c1b57
 		struct mdinfo *mdp;
2c1b57
 
2c1b57
 		mdp = sysfs_read(fd, NULL, GET_ARRAY_STATE);
2c1b57
@@ -928,11 +927,6 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
2c1b57
 
2c1b57
 		sysfs_free(mdp);
2c1b57
 
2c1b57
-		tst->ss->getinfo_super(tst, &mdi, NULL);
2c1b57
-		if (mdi.journal_device_required == 0) {
2c1b57
-			pr_err("%s does not support journal device.\n", devname);
2c1b57
-			return -1;
2c1b57
-		}
2c1b57
 		disc.raid_disk = 0;
2c1b57
 	}
2c1b57
 
2c1b57
diff --git a/mdadm.8.in b/mdadm.8.in
2c1b57
index ecfe9da..461c5de 100644
2c1b57
--- a/mdadm.8.in
2c1b57
+++ b/mdadm.8.in
2c1b57
@@ -1526,9 +1526,8 @@ the device is found or <slot>:missing in case the device is not found.
2c1b57
 
2c1b57
 .TP
2c1b57
 .BR \-\-add-journal
2c1b57
-Recreate journal for RAID-4/5/6 array that lost a journal device. In the
2c1b57
-current implementation, this command cannot add a journal to an array
2c1b57
-that had a failed journal. To avoid interrupting on-going write opertions,
2c1b57
+Add journal to an existing array, or recreate journal for RAID-4/5/6 array
2c1b57
+that lost a journal device. To avoid interrupting on-going write opertions,
2c1b57
 .B \-\-add-journal
2c1b57
 only works for array in Read-Only state.
2c1b57
 
2c1b57
-- 
2c1b57
2.7.4
2c1b57