dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0020-super0-Use-memmove-when-adjusting-sparc2.2-superbloc.patch

59ea72
From 2dcd6492718c2921feac993aa71ed3a7c2522077 Mon Sep 17 00:00:00 2001
59ea72
From: Jes Sorensen <jsorensen@fb.com>
59ea72
Date: Thu, 31 May 2018 13:17:46 -0400
59ea72
Subject: [RHEL7.5 PATCH 20/26] super0: Use memmove() when adjusting sparc2.2
59ea72
 superblock data
59ea72
59ea72
memcpy() does not allow overlapping copies, switch to memmove()
59ea72
59ea72
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
59ea72
---
59ea72
 super0.c | 7 ++++---
59ea72
 1 file changed, 4 insertions(+), 3 deletions(-)
59ea72
59ea72
diff --git a/super0.c b/super0.c
59ea72
index 756cab5..42989b9 100644
59ea72
--- a/super0.c
59ea72
+++ b/super0.c
59ea72
@@ -520,9 +520,10 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
59ea72
 		 * up 4 bytes before continuing
59ea72
 		 */
59ea72
 		__u32 *sb32 = (__u32*)sb;
59ea72
-		memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
59ea72
-		       sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
59ea72
-		       (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
59ea72
+
59ea72
+		memmove(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
59ea72
+			sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
59ea72
+			(MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
59ea72
 		if (verbose >= 0)
59ea72
 			pr_err("adjusting superblock of %s for 2.2/sparc compatibility.\n",
59ea72
 			       devname);
59ea72
-- 
59ea72
2.7.4
59ea72