mdadm/0070-imsm-Remove-dump-restore-implementation.patch
Neil Brown 1c8fb911e6 Accepting request 781064 from home:colyli:branches:Base:System
- Update for latest mdadm-4.1+ patches, this is required by
  jsc#SLE-10078 and jsc#SLE-9348. Mostly the purpose is for
  latest Intel IMSM raid support.
  The following patches also include previous patches with
  new re-ordered prefix numbers.
- Makefile: install mdadm_env.sh to /usr/lib/mdadm (bsc#1111960)
  0000-Makefile-install-mdadm_env.sh-to-usr-lib-mdadm.patch
- Assemble: keep MD_DISK_FAILFAST and MD_DISK_WRITEMOSTLY flag
  (jsc#SLE-10078, jsc#SLE-9348)
  0001-Assemble-keep-MD_DISK_FAILFAST-and-MD_DISK_WRITEMOST.patch
- Document PART-POLICY lines (jsc#SLE-10078, jsc#SLE-9348)
  0002-Document-PART-POLICY-lines.patc
- policy: support devices with multiple paths.
  (jsc#SLE-10078, jsc#SLE-9348)
  0003-policy-support-devices-with-multiple-paths.patch
- mdcheck: add systemd unit files to run mdcheck. (bsc#1115407)
  0004-mdcheck-add-systemd-unit-files-to-run-mdcheck.patch
- Monitor: add system timer to run --oneshot periodically (bsc#1115407)
  0005-Monitor-add-system-timer-to-run-oneshot-periodically.patch
- imsm: update metadata correctly while raid10 double
  (jsc#SLE-10078, jsc#SLE-9348)
  0006-imsm-update-metadata-correctly-while-raid10-double-d.patch
- Assemble: mask FAILFAST and WRITEMOSTLY flags when finding
  (jsc#SLE-10078, jsc#SLE-9348)
  0007-Assemble-mask-FAILFAST-and-WRITEMOSTLY-flags-when-fi.patch
- Grow: avoid overflow in compute_backup_blocks()
  (jsc#SLE-10078, jsc#SLE-9348)
  0008-Grow-avoid-overflow-in-compute_backup_blocks.patch
- Grow: report correct new chunk size. (jsc#SLE-10078, jsc#SLE-9348)
  0009-Grow-report-correct-new-chunk-size.patch

OBS-URL: https://build.opensuse.org/request/show/781064
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=181
2020-03-04 04:49:18 +00:00

97 lines
2.8 KiB
Diff

From 45c43276d02a32876c7e1f9f0d04580595141b3d Mon Sep 17 00:00:00 2001
From: Blazej Kucman <blazej.kucman@intel.com>
Date: Wed, 19 Feb 2020 11:13:17 +0100
Subject: [PATCH] imsm: Remove --dump/--restore implementation
Git-commit: 45c43276d02a32876c7e1f9f0d04580595141b3d
Patch-mainline: mdadm-4.1+
References: jsc#SLE-10078, jsc#SLE-9348
Functionalities --dump and --restore are not supported.
Remove dead code from imsm.
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
super-intel.c | 56 ---------------------------------------------------
1 file changed, 56 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index e4d2122..c9a1af5 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2128,61 +2128,6 @@ static void export_examine_super_imsm(struct supertype *st)
printf("MD_DEVICES=%u\n", mpb->num_disks);
}
-static int copy_metadata_imsm(struct supertype *st, int from, int to)
-{
- /* The second last sector of the device contains
- * the "struct imsm_super" metadata.
- * This contains mpb_size which is the size in bytes of the
- * extended metadata. This is located immediately before
- * the imsm_super.
- * We want to read all that, plus the last sector which
- * may contain a migration record, and write it all
- * to the target.
- */
- void *buf;
- unsigned long long dsize, offset;
- int sectors;
- struct imsm_super *sb;
- struct intel_super *super = st->sb;
- unsigned int sector_size = super->sector_size;
- unsigned int written = 0;
-
- if (posix_memalign(&buf, MAX_SECTOR_SIZE, MAX_SECTOR_SIZE) != 0)
- return 1;
-
- if (!get_dev_size(from, NULL, &dsize))
- goto err;
-
- if (lseek64(from, dsize-(2*sector_size), 0) < 0)
- goto err;
- if ((unsigned int)read(from, buf, sector_size) != sector_size)
- goto err;
- sb = buf;
- if (strncmp((char*)sb->sig, MPB_SIGNATURE, MPB_SIG_LEN) != 0)
- goto err;
-
- sectors = mpb_sectors(sb, sector_size) + 2;
- offset = dsize - sectors * sector_size;
- if (lseek64(from, offset, 0) < 0 ||
- lseek64(to, offset, 0) < 0)
- goto err;
- while (written < sectors * sector_size) {
- int n = sectors*sector_size - written;
- if (n > 4096)
- n = 4096;
- if (read(from, buf, n) != n)
- goto err;
- if (write(to, buf, n) != n)
- goto err;
- written += n;
- }
- free(buf);
- return 0;
-err:
- free(buf);
- return 1;
-}
-
static void detail_super_imsm(struct supertype *st, char *homehost,
char *subarray)
{
@@ -12270,7 +12215,6 @@ struct superswitch super_imsm = {
.reshape_super = imsm_reshape_super,
.manage_reshape = imsm_manage_reshape,
.recover_backup = recover_backup_imsm,
- .copy_metadata = copy_metadata_imsm,
.examine_badblocks = examine_badblocks_imsm,
.match_home = match_home_imsm,
.uuid_from_super= uuid_from_super_imsm,
--
2.25.0