dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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