dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Incremental-Remove-redundant-call-for-GET_ARRAY_INFO.patch

2c1b57
From 5b13d2e1fb8abecddd4e28e67facac5d7ef2cef3 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
Date: Wed, 29 Mar 2017 14:40:36 -0400
2c1b57
Subject: [RHEL7.5 PATCH 038/169] Incremental: Remove redundant call for
2c1b57
 GET_ARRAY_INFO
2c1b57
2c1b57
The code above just called md_get_array_info() and only reached this
2c1b57
point if it returned an error that isn't ENODEV, so it's pointless to
2c1b57
check this again here.
2c1b57
2c1b57
In addition it was incorrectly retrieving ioctl data into a
2c1b57
mdu_bitmap_file_t instead of mdu_array_info_t.
2c1b57
2c1b57
Fixes: ("8382f19 Add new mode: --incremental")
2c1b57
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
---
2c1b57
 Incremental.c | 14 ++++++--------
2c1b57
 1 file changed, 6 insertions(+), 8 deletions(-)
2c1b57
2c1b57
diff --git a/Incremental.c b/Incremental.c
2c1b57
index 1f12c77..802e525 100644
2c1b57
--- a/Incremental.c
2c1b57
+++ b/Incremental.c
2c1b57
@@ -1345,7 +1345,6 @@ int IncrementalScan(struct context *c, char *devnm)
2c1b57
 restart:
2c1b57
 	for (me = mapl ; me ; me = me->next) {
2c1b57
 		mdu_array_info_t array;
2c1b57
-		mdu_bitmap_file_t bmf;
2c1b57
 		struct mdinfo *sra;
2c1b57
 		int mdfd;
2c1b57
 
2c1b57
@@ -1405,13 +1404,12 @@ restart:
2c1b57
 			 * is a hint only
2c1b57
 			 */
2c1b57
 			int added = -1;
2c1b57
-			if (ioctl(mdfd, GET_ARRAY_INFO, &bmf) < 0) {
2c1b57
-				int bmfd = open(mddev->bitmap_file, O_RDWR);
2c1b57
-				if (bmfd >= 0) {
2c1b57
-					added = ioctl(mdfd, SET_BITMAP_FILE,
2c1b57
-						      bmfd);
2c1b57
-					close(bmfd);
2c1b57
-				}
2c1b57
+			int bmfd;
2c1b57
+
2c1b57
+			bmfd = open(mddev->bitmap_file, O_RDWR);
2c1b57
+			if (bmfd >= 0) {
2c1b57
+				added = ioctl(mdfd, SET_BITMAP_FILE, bmfd);
2c1b57
+				close(bmfd);
2c1b57
 			}
2c1b57
 			if (c->verbose >= 0) {
2c1b57
 				if (added == 0)
2c1b57
-- 
2c1b57
2.7.4
2c1b57