dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Grow-set-component-size-prior-to-array-size.patch

2c1b57
From 07c45a1871df0a70beb8da80d11601d33c7a5de2 Mon Sep 17 00:00:00 2001
2c1b57
From: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
Date: Mon, 5 Jun 2017 16:09:44 +0200
2c1b57
Subject: [RHEL7.5 PATCH 150/169] Grow: set component size prior to array
2c1b57
 size
2c1b57
2c1b57
It is a partial revert of commit 758b327cf5a7 ("Grow: Remove unnecessary
2c1b57
optimization"). For native metadata component size is set in kernel for
2c1b57
entire disk space. As external metadata supports multiple arrays within
2c1b57
one disk, the component size is set to array size. If component size is
2c1b57
not updated prior to array size update, the grow operation fails.
2c1b57
2c1b57
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Grow.c | 2 ++
2c1b57
 1 file changed, 2 insertions(+)
2c1b57
2c1b57
diff --git a/Grow.c b/Grow.c
2c1b57
index ecf5ca0..4ecb1d8 100644
2c1b57
--- a/Grow.c
2c1b57
+++ b/Grow.c
2c1b57
@@ -1977,6 +1977,8 @@ int Grow_reshape(char *devname, int fd,
2c1b57
 		 */
2c1b57
 		min_csize = 0;
2c1b57
 		for (mdi = sra->devs; mdi; mdi = mdi->next) {
2c1b57
+			sysfs_set_num(sra, mdi, "size", s->size == MAX_SIZE ? 0
2c1b57
+				      : s->size);
2c1b57
 			if (array.not_persistent == 0 &&
2c1b57
 			    array.major_version == 0 &&
2c1b57
 			    get_linux_version() < 3001000) {
2c1b57
-- 
2c1b57
2.7.4
2c1b57