Tomasz Majchrzak [Tue, 29 Nov 2016 13:02:30 +0000 (14:02 +0100)]
imsm: record new bad block in bad block log
Check for a duplicate first or try to merge it with existing bad block.
If block range exceeds BBM_LOG_MAX_LBA_ENTRY_VAL (256) blocks, it must
be split into multiple ranges. Fail if maximum number of bad blocks has
been already reached.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Wed, 30 Nov 2016 08:41:16 +0000 (09:41 +0100)]
imsm: give md list of known bad blocks on startup
On create set bad block support flag for each drive. On assmble also
provide a list of known bad blocks. Bad blocks are stored in metadata
per disk so they have to be checked against volume boundaries
beforehand.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Tue, 29 Nov 2016 13:02:28 +0000 (14:02 +0100)]
imsm: write bad block log on metadata sync
Pre-allocate memory for largest possible bad block section when monitor
is being opened to avoid a need for memory allocation on metadata sync.
If memory for a structure has been allocated in mpb buffer but it hasn't
been used yet, it will be taken by next buffer grow, leading to
insufficient memory on metadata flush. Start tracking such memory and
take it into calculation when growing a buffer. Also assert has been
added to debug mode to warn when more metadata has been written than
memory allocated.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Thu, 27 Oct 2016 08:53:45 +0000 (10:53 +0200)]
mdmon: bad block support for external metadata - clear bad blocks
If an update of acknowledged bad blocks file is notified, read entire
bad block list from sysfs file and compare it against local list of bad
blocks. If any obsolete entries are found, remove them from metadata.
As mdmon cannot perform any memory allocation, new superswitch method
get_bad_blocks is expected to return a list of bad blocks in metadata
without allocating memory. It's up to metadata handler to allocate all
required memory in advance.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Thu, 27 Oct 2016 08:53:44 +0000 (10:53 +0200)]
mdmon: bad block support for external metadata - store bad blocks
If md has changed the state to 'blocked' and metadata handler supports
bad blocks, try process them first. If metadata handler has successfully
stored bad block, acknowledge it to md via 'badblocks' sysfs file. If
metadata handler has failed to store the new bad block (ie. lack of
space), remove bad block support for a disk by writing "-external_bbl"
to state sysfs file. If all bad blocks have been acknowledged, request
to unblock the array.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Mon, 28 Nov 2016 14:07:05 +0000 (15:07 +0100)]
mdadm: bad block support for external metadata - initialization
If metadata handler provides support for bad blocks, tell md by writing
'external_bbl' to rdev state file (both on create and assemble),
followed by a list of known bad blocks written via sysfs 'bad_blocks'
file.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Pawel Baldysiak [Thu, 24 Nov 2016 08:48:24 +0000 (09:48 +0100)]
IMSM: Update num_data_stripes during migration
This patch adds updataing num_data_stripes during reshape.
Previously this field once set during creation was never updated.
Also, num_data_strips value multipied by chunk_size is used
for set proper component size for RAID5.
Tomasz Majchrzak [Thu, 27 Oct 2016 09:34:16 +0000 (11:34 +0200)]
Increase buffer for sysfs disk state
Bad block support has incremented sysfs disk state reported by kernel
("external_bbl") so it became longer than 20 bytes. It causes reshape to
fail as it reads truncated entry from sysfs.
Increase buffer so it can accommodate the string including all state
values currently implemented in kernel at the same time.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Fri, 28 Oct 2016 08:35:50 +0000 (10:35 +0200)]
Increase buffer for sysfs path
'unacknowledged_bad_blocks' is a long name for sysfs property and it
makes sysfs path over 50 characters long. Increase buffer to the double
length of the longest path available in sysfs at the moment.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Pawel Baldysiak [Thu, 17 Nov 2016 13:58:38 +0000 (14:58 +0100)]
IMSM: 4Kn drives support - adapt general migration record
Convert general migration record for 4Kn drives prior to write and post
read. Calculate record location based on sector size, don't just assume
it's 512. Assure buffer address is aligned to 4096 so write operation
avoids caching.
Pawel Baldysiak [Thu, 17 Nov 2016 13:58:37 +0000 (14:58 +0100)]
IMSM: Add support for 4Kn sector size drives
This patch adds support for drives with 4Kn sector size
for IMSM metadata. Mixing member drives with 4kn and 512
is not allowed. Some offsets were aligned with sector size.
Internal metadata representation and all calculations
are still based on 512-byte sector sizes. This
implementation converts only sector based values
when reading/writing to drive, because they needs to be
stored in metadata according to accual member drive sector size.
super1: fix setting bad block log offset in write_init_super1()
Commit f79bbf4f6904 ("super1: don't put the bblog at the end of the free
space.") changed the location of the bad block log to be after the
write-intent bitmap, but a fixed offset was used and it can make bbl
overlap with the bitmap, especially when using a small bitmap chunk.
This patch changes it to use the actual offset and size of the bitmap.
It also joins the cases for v1.1 and v1.2 superblock because the code
was very similar.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super1: make internal bitmap size calculations more consistent
Determining internal bitmap size is performed using two different
functions (bitmap_sectors() and calc_bitmap_size()) and in
getinfo_super1() it is calculated in yet another way. Each of these
methods give slightly different results. The most accurate is
calc_bitmap_size() but it also has a rounding issue. So:
- fix the rounding issue in calc_bitmap_size() using bitmap_bits()
- replace usages of bitmap_sectors() and open-coded calculations with
calc_bitmap_size()
- remove bitmap_sectors()
- move bitmap_bits() to mdadm.h as inline - otherwise mdassemble won't
compile (it does not use bitmap.c)
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Pawel Baldysiak [Fri, 21 Oct 2016 09:37:51 +0000 (11:37 +0200)]
Lib.c: Fix geting devname for devices with long path
In scenario where VMD is enabled, and "x8" type of NVMe drive is
plugged into PCIe switch - the path will be longer than 200 chars
(additional VMD domain + 2 level of PCIe switches).
This patch makes the buffer big enough to handle this kind of
configurations.
Pawel Baldysiak [Mon, 24 Oct 2016 08:19:52 +0000 (10:19 +0200)]
IMSM: Add warning message when x8-type device is used
This patch adds the warning message when x8-type device
is used with IMSM metadata. x8 device is a special
NVMe drive - two of them on a single PCIe card.
This card could be a single point of failure for
RAID levels different than RAID0. x8 devices have
serial number ending with "-A/-B" or "-1/-2".
Tomasz Majchrzak [Mon, 24 Oct 2016 10:00:17 +0000 (12:00 +0200)]
imsm: load migration record from right disk
Migration record is only stored on disks in first and second metadata
slot. The function to load the record incorrectly passes disk slot as
disk index. If rebuilt has taken place for a container, disk slot
doesn't match disk index so it causes migration record to be read from a
disk it has not been written to. As a result reshape operation fails.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Yilong Ren [Wed, 26 Oct 2016 08:10:38 +0000 (16:10 +0800)]
raid6check.c: fix "misleading-indentation" error
To fix the following error info:
root@vm-lkp-nex04-8G-7 /tmp/mdadm# make test
cc -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter -ggdb -DSendmail=\""/usr/sbin/sendmail -t"\" -DCONFFILE=\"/etc/mdadm.conf\" -DCONFFILE2=\"/etc/mdadm/mdadm.conf\" -DMAP_DIR=\"/run/mdadm\" -DMAP_FILE=\"map\" -DMDMON_DIR=\"/run/mdadm\" -DFAILED_SLOTS_DIR=\"/run/mdadm/failed-slots\" -DNO_COROSYNC -DNO_DLM -DVERSION=\"3.4-43-g1dcee1c\" -DVERS_DATE="\"06th April 2016\"" -DUSE_PTHREADS -DBINDIR=\"/sbin\" -c -o raid6check.o raid6check.c
raid6check.c: In function 'manual_repair':
raid6check.c:267:4: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
else
^~~~
raid6check.c:269:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
printf("Repairing D(%d) and P\n", failed_data);
^~~~~~
cc1: all warnings being treated as errors
<builtin>: recipe for target 'raid6check.o' failed
make: *** [raid6check.o] Error 1
root@vm-lkp-nex04-8G-7 /tmp/mdadm#
James Clarke [Mon, 17 Oct 2016 20:16:01 +0000 (21:16 +0100)]
Fix bus error when accessing MBR partition records
Since the MBR layout only has partition records as 2-byte aligned, the
32-bit fields in them are not aligned. Thus, they cannot be accessed on
some architectures (such as SPARC) by using a "struct MBR_part_record *"
pointer, as the compiler can assume that the pointer is properly aligned.
Instead, the records must be accessed by going through the MBR struct
itself every time.
Signed-off-by: James Clarke <jrtc27@jrtc27.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Allow level migration only for single-array container
IMSM doesn't allow to change RAID level of array in container with two
arrays but array count check is being done too late (after removing disks)
and in some cases (e. g. RAID 0 and RAID 1 migrated to RAID 0) both arrays
become degraded. This patch adds array count check before disks are being
removed.
Chunk size change of RAID 10 array fails because it is not supported but
invalid values still are being written to metadata and array cannot be
assembled after stop. Operation should be blocked before metadata update.
Guoqing Jiang [Wed, 12 Oct 2016 06:24:07 +0000 (02:24 -0400)]
super1: make write_bitmap1 compatible with previous mdadm versions
For older mdadm version, v1.x metadata has different bitmap_offset,
we can't ensure all the bitmaps are on a 4K boundary since writing
4K for bitmap could corrupt the superblock, and Anthony reported
the bug about it at below link.
So let's check about the alignment for bitmap_offset before set
the boundary to 4096 unconditionally. Thanks for Neil's detailed
explanation.
Reported-by: Anthony DeRobertis <anthony@derobert.net> Fixes: 95a05b37e8eb ("Create n bitmaps for clustered mode") Cc: Neil Brown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Don't rely on SCSI ioctl for reading NVMe serials - SCSI emulation for
NVMe devices can be disabled in the kernel config. Instead, try to get a
serial from /sys/block/nvme*/device/serial. If that fails for whatever
reason (i.e. no such attribute in old kernels) - fall back to the SCSI
method.
This also moves some SCSI-specific code from imsm_read_serial() to
scsi_get_serial().
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Reviewed-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
mdadm recognizes devices with partition table as part of an RAID array
and invalid warning message is displayed. After this fix proper warning
messages are being displayed for MBR/GPT disks and devices with RAID
metadata.
Robert LeBlanc [Wed, 24 Aug 2016 16:10:44 +0000 (10:10 -0600)]
mdopen: Prevent overrunning the devname buffer when copying devnm into it for long md names.
Linux allows for 32 character device names. When using the maximum
size device name and also storing "/dev/", devname needs to be 37
character long to store the complete device name.
i.e. "/dev/md_abcdefghijklmnopqrstuvwxyz12\0"
Signed-off-by: Robert LeBlanc<robert@leblancnet.us> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Song Liu [Fri, 12 Aug 2016 00:14:13 +0000 (17:14 -0700)]
mdadm: put journal device in right place of --detail
When there is failed HDDs, journal device showed in wrong place
of --detail:
Number Major Minor RaidDevice State
4 8 24 - journal /dev/sdb8
1 8 18 1 active sync /dev/sdb2
2 8 19 2 active sync /dev/sdb3
3 8 21 3 active sync /dev/sdb5
0 8 17 - faulty /dev/sdb1
This patch fixed the output as:
Number Major Minor RaidDevice State
- 0 0 0 removed
1 8 18 1 active sync /dev/sdb2
2 8 19 2 active sync /dev/sdb3
3 8 21 3 active sync /dev/sdb5
Reported-by: Yi Zhang <yizhan@redhat.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Song Liu [Fri, 12 Aug 2016 00:10:04 +0000 (17:10 -0700)]
mdadm: add man page for --add-journal
Add the following to man page:
--add-journal
Recreate journal for RAID-4/5/6 array that lost a journal device.
In the current implementation, this command cannot add a journal
to an array that had a failed journal. To avoid interrupting
on-going write opertion --add-journal only works for array in
Read-Only state.
Reported-by: Yi Zhang <yizhan@redhat.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Monitor: release /proc/mdstat fd when no arrays present
If md kernel module is reloaded, /proc/mdstat cannot be accessed ("cat:
/proc/mdstat: No such file or directory"). The reason is mdadm monitor
still holds a file descriptor to previous /proc/mdstat instance. It
leads to really confusing outcome of the following operations - mdadm
seems to run without errors, however some udev rules don't get executed
and new array doesn't work.
Add a check if lseek was successful as it fails if md kernel module has
been unloaded - close a file descriptor then. The problem is mdadm
monitor doesn't always do it before next operation takes place. To
prevent it monitor always releases /proc/mdstat descriptor when there
are no arrays to be monitored, just in case driver unload happens in a
moment.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tomasz Majchrzak [Thu, 21 Jul 2016 07:59:42 +0000 (09:59 +0200)]
Remove: container should wait for an array to release a drive
A 'faulty' drive is being removed from a container after it has been
released by an array, however there is a race there. The drive is
released asynchronously by a monitor but sometimes it doesn't happen
before container checks it. It results in a container refusing to remove
a drive as it still seems to be a part of some array.
It seems 'ping_monitor' could be a solution here to assure monitor has
had a chance to process the events, however it doesn't resolve the
problem - sometimes an array has to request a release of the drive few
times (as the array is busy) and single 'ping_monitor' call is not
sufficient. As there is no way to query monitor progress, it forces us
to retry a check several times before an error is returned.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
The sync_completed can be set to such values:
- two numbers of processed sectors and total during synchronization,
separated with '/';
- 'none' if synchronization process is stopped;
- 'delayed' if synchronization process is delayed.
Handle value of sync_completed not only as numbers but
also check for 'none' and 'delayed'.
Pawel Baldysiak [Thu, 16 Jun 2016 09:12:20 +0000 (11:12 +0200)]
monitor: Make sure that last_checkpoint is set to 0 after sync
In a case of successful completion of a resync (in the last step)
- read_and_act sometimes still reads sync_action as "resync"
but sync_completed already is set to component_size.
When this race occurs, sync operation is
marked as finished, but last_checkpoint is
overwritten with sync_completed. It will cause next
sync operation (ie. reshape) to be reported as complete immediately
after start - mdmon will write successful completion of the reshape
to metadata. This patch sets last_checkpoint to 0 once the sync
is completed to stop it happening.
Xiao Ni [Thu, 16 Jun 2016 01:41:02 +0000 (09:41 +0800)]
MDADM:Check mdinfo->reshape_active more times before calling Grow_continue
When reshaping a 3 drives raid5 to 4 drives raid5, there is a chance that
it can't start the reshape. If the disks are not enough to have spaces for
relocating the data_offset, it needs to call start_reshape and then run
mdadm --grow --continue by systemd. But mdadm --grow --continue fails
because it checkes that info->reshape_active is 0.
The info->reshape_active is got from the superblock of underlying devices.
Function start_reshape write reshape to /sys/../sync_action. Before writing
latest superblock to underlying devices, mdadm --grow --continue is called.
There is a chance info->reshape_active is 0. We should wait for superblock
updating more time before calling Grow_continue.
Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Mike Lovell [Wed, 18 May 2016 18:23:13 +0000 (12:23 -0600)]
Use dev_t for devnm2devid and devid2devnm
Commit 4dd2df0966ec added a trip through makedev(), major(), and minor() for
device major and minor numbers. This would cause mdadm to fail in operating
on a device with a minor number bigger than (2^19)-1 due to it changing
from dev_t to a signed int and back.
Where this was found as a problem was when a array was created with a device
specified as a name like /dev/md/raidname and there were already 128 arrays
on the system. In this case, mdadm would chose 1048575 ((2^20)-1) for the
array and minor number. This would cause the major and minor number to become
negative when generated from devnm2devid() and passed to major() and minor()
in open_dev_excl(). open_dev_excl() would then call dev_open() which would
detect the negative minor number and call open() on the *char containing the
major:minor pair which isn't a valid file.
Signed-off-by: Mike Lovell <mlovell@bluehost.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Pawel Baldysiak [Tue, 17 May 2016 11:24:41 +0000 (13:24 +0200)]
IMSM: retry reading sync_completed during reshape
The sync_completed after restarting a reshape
(for example - after reboot) is set to "delayed" until
mdmon changes the state. Mdadm does not wait for that change with
old kernels. If this condition occurs - it exits and reshape
is not continuing. This patch adds retry of reading sync_complete
with a delay. It gives time for mdmon to change the "delayed" state.
Guoqing Jiang [Wed, 11 May 2016 09:31:36 +0000 (17:31 +0800)]
super1: add more checks for NodeNumUpdate option
There are some cases which didn't need to check the space
is enough or not for NodeNumUpdate option.
1. for array which does not have clustered bitmap.
2. "--nodes" parameter is 0 (eg, add a disk to clustered raid).
3. if "--nodes" parameter is set to a smaller num than
current bms->nodes.
Jes Sorensen [Thu, 12 May 2016 19:19:16 +0000 (15:19 -0400)]
mdadm: Make add_internal_bitmap() return 0 on success
add_internal_bitmap() returned 1 on success and 0 on error which is
inconsistent. This changes it to return 0 on success and use more
reasonable error codes on error.
super1: Clear memory allocated for superblock + bitmap before use
load_super1() did not clear memory allocated for the superblock +
bitmap. This causes issues if the superblock does not contain a bitmap
as later checks of bitmap features would rely on the bits being
cleared.
This bug has been around for a long time, but was only exposed in
mdadm-3.4 with the introduction of the clustering code.
Reported-by: Jan Stodola <jstodola@redhat.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
These are similar to stat2devnm() and fd2devnm() but not limited to md
devices. If the device is a partition they will return its kernel name,
not the whole device's name. For more information see commit: 8d83493 ("Introduce devid2kname - slightly different to devid2devnm.")
Also remove unsued declaration for fmt_devname().
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
zhilong [Fri, 25 Mar 2016 02:22:03 +0000 (10:22 +0800)]
mdadm:Add '--nodes' option in GROW mode
mdadm:add '--nodes' option in GROW mode, because
'Cluster nodes' is set 4 by default if the nodes
parameter is not specified when switch bitmap
from none to clustered.
Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Jes Sorensen [Wed, 9 Mar 2016 19:37:46 +0000 (14:37 -0500)]
mdadm: Cleanup conditionals
Be more consistent in the formatting of conditionals. Don't split on
multiple lines if not needed, don't overflow the 80 character line
length, put the condition operator at the end of the line of
multi-line conditionals, etc.
This should be purely cosmetic.... famous last words!
Yi Zhang [Fri, 11 Mar 2016 09:26:40 +0000 (17:26 +0800)]
Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5
Notify "Can only convert a 2-device array to RAID5" instead of
"Impossibly level change request for RAID1" when convert from
RAID1 to RAID5 if the disk num is not equal two like RAID4/5->RAID1
did.
Signed-off-by: Yi Zhang <yizhan@redhat.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Pawel Baldysiak [Fri, 11 Mar 2016 15:47:16 +0000 (16:47 +0100)]
super-intel: Simplify for() loop in ahci_enumerate_ports
This patch simplifies for() loop used in
ahci_enumerate_ports(). It makes it more readable.
Similar thing was done in b913501
({platform,super}-intel: Fix two resource leaks).
Pawel Baldysiak [Fri, 11 Mar 2016 15:47:15 +0000 (16:47 +0100)]
super-intel: Make print_vmd_attached_devs() return int again
This patch reverts a0abe1e
(super-intel: Make print_found_intel_controllers() return void)
and make this function "return int" again.
Also, interpreting the return value is added.
Pawel Baldysiak [Fri, 11 Mar 2016 12:49:07 +0000 (13:49 +0100)]
Grow: close fd earlier to avoid "cannot get excl access" when stopping
If this file descriptor is not closed here, it remains open during
reshape process and stopping process will end up with
"cannot get exclusive access to container".
Once this file descriptor is no longer needed - it can be closed.
Hannes Reinecke [Wed, 9 Mar 2016 05:20:18 +0000 (13:20 +0800)]
Fix regression during add devices
Commit d180d2aa2a17 ("Manage: fix test for 'is array failed'.")
introduced a regression which would not allow to re-add new
drivers to a failed array.
Fixes: d180d2aa2a17 ("Manage: fix test for 'is array failed'.") Signed-off-by: Hannes Reinecke <hare@suse.de> Cc: Coly Li <colyli@suse.de> Cc: Neil Brown <neilb@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Jes Sorensen [Mon, 7 Mar 2016 19:50:06 +0000 (14:50 -0500)]
super1: Fix potential buffer overflows when copying cluster_name
cmap_get_string() used to retrieve cluster_name does not restrict it's
size. To prevent buffer overflows use the size of the destination
buffer, not strlen() of the source, and null terminate the copied
string.
Fixes: 0aa2f15b ("mdadm: add the ability to change cluster name)" Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>