thirdparty/mdadm.git
4 years agoFix RAID metadata check
Mariusz Dabrowski [Thu, 22 Sep 2016 07:02:11 +0000 (09:02 +0200)] 
Fix RAID metadata check

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.

Signed-off-by: Mariusz Dabrowski <mariusz.dabrowski@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoimsm: remove redundant characters from some error messages
Artur Paszkiewicz [Fri, 16 Sep 2016 13:25:14 +0000 (15:25 +0200)] 
imsm: remove redundant characters from some error messages

Fix the cases that produced messages like "mdadm: : The message".

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoimsm: do not activate spares for uninitialized member arrays
Artur Paszkiewicz [Thu, 15 Sep 2016 07:53:58 +0000 (09:53 +0200)] 
imsm: do not activate spares for uninitialized member arrays

This fixes some issues when a member array is created with "missing"
devices in a container that has more devices than used in the member
array.

Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm: fix a buffer overflow
Song Liu [Thu, 8 Sep 2016 18:21:07 +0000 (11:21 -0700)] 
mdadm: fix a buffer overflow

struct mdp_superblock_1.set_name is 32B long, but struct mdinfo.name
is 33B long. So we need strncpy instead strcpy to avoid buffer
overflow.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdopen: Prevent overrunning the devname buffer when copying devnm into it for long...
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>
4 years agobitmap: Mark a number of local functions static
Jes Sorensen [Mon, 15 Aug 2016 20:35:28 +0000 (16:35 -0400)] 
bitmap: Mark a number of local functions static

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agobitmap: Handle errors when reading bitmap info for cluster nodes
Jes Sorensen [Mon, 15 Aug 2016 20:21:33 +0000 (16:21 -0400)] 
bitmap: Handle errors when reading bitmap info for cluster nodes

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agobitmap: Simplify code for bitmap_file_open()
Jes Sorensen [Mon, 15 Aug 2016 20:16:05 +0000 (16:16 -0400)] 
bitmap: Simplify code for bitmap_file_open()

By switching to open+fstat rather than stat+open the code can be
simplified and avoid duplicating the open handling.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper0: Clean up formatting in examine_super0()
Jes Sorensen [Mon, 15 Aug 2016 19:56:23 +0000 (15:56 -0400)] 
super0: Clean up formatting in examine_super0()

No funcionality change - should be purely cosmetic

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper0: Fix spelling of 'version' in comment and fix formatting
Jes Sorensen [Mon, 15 Aug 2016 19:49:59 +0000 (15:49 -0400)] 
super0: Fix spelling of 'version' in comment and fix formatting

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper0: Use random_uuid() in init_super0()
Jes Sorensen [Mon, 15 Aug 2016 19:48:56 +0000 (15:48 -0400)] 
super0: Use random_uuid() in init_super0()

This shaves another 80 bytes off the mdadm binary.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoIntroduce random_uuid() helper function
Jes Sorensen [Mon, 15 Aug 2016 19:41:34 +0000 (15:41 -0400)] 
Introduce random_uuid() helper function

This gets rid of 5 nearly identical copies of the same code, and
reduces the binary size of mdadm by over 700 bytes on x86_64.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm.h: Fix build problem against newer glibc
Jes Sorensen [Mon, 15 Aug 2016 15:30:39 +0000 (11:30 -0400)] 
mdadm.h: Fix build problem against newer glibc

Newer glibc requires direct include of sys/sysmacros.h in order to
access makedev().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm: put journal device in right place of --detail
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

       0       8       17        -      faulty   /dev/sdb1
       4       8       24        -      journal   /dev/sdb8

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>
4 years agomdadm: add man page for --add-journal
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>
4 years agolib: Various coding style cleanups
Jes Sorensen [Thu, 11 Aug 2016 20:01:00 +0000 (16:01 -0400)] 
lib: Various coding style cleanups

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agolib: Avoid if and return on the same line
Jes Sorensen [Thu, 11 Aug 2016 19:53:29 +0000 (15:53 -0400)] 
lib: Avoid if and return on the same line

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosysfs: Avoid if and return on the same line
Jes Sorensen [Thu, 11 Aug 2016 19:52:48 +0000 (15:52 -0400)] 
sysfs: Avoid if and return on the same line

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: Avoid if and return on the same line
Jes Sorensen [Thu, 11 Aug 2016 19:52:02 +0000 (15:52 -0400)] 
super1: Avoid if and return on the same line

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agorestripe: Avoid if and return on the same line
Jes Sorensen [Thu, 11 Aug 2016 19:51:00 +0000 (15:51 -0400)] 
restripe: Avoid if and return on the same line

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoutil: Never have if and return on the same line
Jes Sorensen [Thu, 11 Aug 2016 19:48:47 +0000 (15:48 -0400)] 
util: Never have if and return on the same line

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoconfig: Various stylistic cleanups
Jes Sorensen [Thu, 11 Aug 2016 19:48:09 +0000 (15:48 -0400)] 
config: Various stylistic cleanups

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoconfig: Use xcalloc() rather than xmalloc()+memset()
Jes Sorensen [Thu, 11 Aug 2016 19:32:34 +0000 (15:32 -0400)] 
config: Use xcalloc() rather than xmalloc()+memset()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoIncremental: don't try to load_container() for a subarray
Artur Paszkiewicz [Tue, 9 Aug 2016 08:05:51 +0000 (10:05 +0200)] 
Incremental: don't try to load_container() for a subarray

mdadm -IRs would exit with a non-zero status because of this.

Reported-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm:add 'clustered' in typo prompt when specify wrong param for bitmap
Zhilong Liu [Tue, 2 Aug 2016 09:18:40 +0000 (05:18 -0400)] 
mdadm:add 'clustered' in typo prompt when specify wrong param for bitmap

  mdadm: 'clustered' bitmap has already supported, thus add the
         prompt if users specify wrong value for bitmap param.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoMonitor: release /proc/mdstat fd when no arrays present
Tomasz Majchrzak [Tue, 5 Jul 2016 07:12:51 +0000 (09:12 +0200)] 
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>
4 years agoRemove: container should wait for an array to release a drive
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>
4 years agoimsm: properly handle values of sync_completed
Alexey Obitotskiy [Thu, 16 Jun 2016 09:31:37 +0000 (11:31 +0200)] 
imsm: properly handle values of sync_completed

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'.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
Reviewed-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoimsm: add handling of sync_action is equal to 'idle'
Alexey Obitotskiy [Thu, 16 Jun 2016 09:31:36 +0000 (11:31 +0200)] 
imsm: add handling of sync_action is equal to 'idle'

After resync is stopped sync_action value become 'idle'.
We treat this case as normal termination of waiting, not as error.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
Reviewed-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomonitor: Make sure that last_checkpoint is set to 0 after sync
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.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoMDADM:Check mdinfo->reshape_active more times before calling Grow_continue
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>
4 years agoThe sys_name array in the mdinfo structure is 20 bytes of storage.
Nikhil Kshirsagar [Fri, 10 Jun 2016 03:20:10 +0000 (08:50 +0530)] 
The sys_name array in the mdinfo structure is 20 bytes of storage.

Increasing the size of this array to 32 bytes to handle cases with
longer device names.

Signed-off-by: Nikhil Kshirsagar <nkshirsa@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoMonitor: Use sysfs_free() to free object returned by sysfs_read()
Jes Sorensen [Fri, 10 Jun 2016 18:54:53 +0000 (14:54 -0400)] 
Monitor: Use sysfs_free() to free object returned by sysfs_read()

We should always use sysfs_free() to release sysfs_* allocated
objects.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoChange behavior in find_free_devnm when wrapping around.
Mike Lovell [Wed, 18 May 2016 18:23:14 +0000 (12:23 -0600)] 
Change behavior in find_free_devnm when wrapping around.

Newer kernels don't allow for specifying an array larger than 511. This
makes it so find_free_devnm wraps to 511 instead of 2^20 - 1.

Signed-off-by: Mike Lovell <mlovell@bluehost.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoUse dev_t for devnm2devid and devid2devnm
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>
4 years agoIMSM: retry reading sync_completed during reshape
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.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: add more checks for NodeNumUpdate option
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.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Apply some more consistent formatting to Grow_addbitmap()
Jes Sorensen [Thu, 12 May 2016 18:42:12 +0000 (14:42 -0400)] 
Grow: Apply some more consistent formatting to Grow_addbitmap()

This should be purely cosmetic and cause no functional change
... famous last words!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Simplify error paths in Grow_addbitmap()
Jes Sorensen [Thu, 12 May 2016 18:37:44 +0000 (14:37 -0400)] 
Grow: Simplify error paths in Grow_addbitmap()

This gets rid of some repeated exit paths, making the code a little
cleaner.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm: Make add_internal_bitmap() return 0 on success
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.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Handle failure to load superblock in Grow_addbitmap()
Jes Sorensen [Thu, 12 May 2016 18:30:10 +0000 (14:30 -0400)] 
Grow: Handle failure to load superblock in Grow_addbitmap()

Reported-by: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Grow_addbitmap() reduce indentation
Jes Sorensen [Thu, 12 May 2016 18:27:11 +0000 (14:27 -0400)] 
Grow: Grow_addbitmap() reduce indentation

This makes the code a little more readable.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: make the check for NodeNumUpdate more accurate
Guoqing Jiang [Mon, 9 May 2016 02:22:58 +0000 (10:22 +0800)] 
super1: make the check for NodeNumUpdate more accurate

We missed to check the version is BITMAP_MAJOR_CLUSTERED
or not, otherwise mdadm can't create array with other 1.x
metadatas (1.0 and 1.1).

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: don't update node nums if it is not more than 1
Guoqing Jiang [Wed, 4 May 2016 08:33:44 +0000 (16:33 +0800)] 
super1: don't update node nums if it is not more than 1

We at least need two nodes for cluster raid so make the
check before update node nums.

Reported-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoCreate: check the node nums when create clustered raid
Guoqing Jiang [Wed, 4 May 2016 08:33:43 +0000 (16:33 +0800)] 
Create: check the node nums when create clustered raid

It doesn't make sense to create a clustered raid
with only 1 node.

Reported-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: Clear memory allocated for superblock + bitmap before use
Jes Sorensen [Wed, 6 Apr 2016 20:13:59 +0000 (16:13 -0400)] 
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>
4 years agoConsistent use of metric prefix in manpage
Marko Hauptvogel [Thu, 31 Mar 2016 22:21:53 +0000 (00:21 +0200)] 
Consistent use of metric prefix in manpage

Added the optional K suffix for completeness, as it
is allowed by util.c's parse_size(char*).

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoIntroduce stat2kname() and fd2kname()
Artur Paszkiewicz [Tue, 29 Mar 2016 13:20:29 +0000 (15:20 +0200)] 
Introduce stat2kname() and fd2kname()

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>
4 years agomdadm:Add '--nodes' option in GROW mode
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>
4 years agoChange the option from NoUpdate to NodeNumUpdate
Guoqing Jiang [Thu, 24 Mar 2016 10:00:35 +0000 (18:00 +0800)] 
Change the option from NoUpdate to NodeNumUpdate

Actually, we need to use NodeNumUpdate here to
ensure there are enough spaces for those nodes.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoAssemble: No need for dummy NULL pointer when calling map_update()
Jes Sorensen [Wed, 9 Mar 2016 20:26:50 +0000 (15:26 -0500)] 
Assemble: No need for dummy NULL pointer when calling map_update()

assemble_container_content() doesn't need a dummy NULL pointer
variable for calling map_update. Passing NULL directly is sufficient.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoAssemble: assemble_container_content(): Avoid superfluous NULL initialization
Jes Sorensen [Wed, 9 Mar 2016 20:21:26 +0000 (15:21 -0500)] 
Assemble: assemble_container_content(): Avoid superfluous NULL initialization

No need to init avail to NULL since it will only be accessed after
assignment.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage: Manage_subdevs(): Remove unnecessary NULL initialization
Jes Sorensen [Wed, 9 Mar 2016 20:08:55 +0000 (15:08 -0500)] 
Manage: Manage_subdevs(): Remove unnecessary NULL initialization

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage: Manage_add(): Avoid NULL initialization of dev_st
Jes Sorensen [Wed, 9 Mar 2016 19:51:03 +0000 (14:51 -0500)] 
Manage: Manage_add(): Avoid NULL initialization of dev_st

dev_st is only ever assigned if array->not_persistent == 0, so move
the second use of it into the same scope where the assignment is
made.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm: Cleanup conditionals
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!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper_intel: imsm_manage_reshape(): Fix potential NULL pointer dereference
Jes Sorensen [Wed, 9 Mar 2016 19:11:02 +0000 (14:11 -0500)] 
super_intel: imsm_manage_reshape(): Fix potential NULL pointer dereference

If sra == NULL we cannot goto abort, as it would result in calls to
sysfs_set_num() which would dereference sra.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper-intel: Remove excessive NULL/0 variable initialization
Jes Sorensen [Wed, 9 Mar 2016 19:06:29 +0000 (14:06 -0500)] 
super-intel: Remove excessive NULL/0 variable initialization

This removes a pile of unnecessary NULL/0 initialization of variables.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage: Manage_add(): Fix memory leak
Jes Sorensen [Mon, 7 Mar 2016 16:51:24 +0000 (11:51 -0500)] 
Manage: Manage_add(): Fix memory leak

sysfs_read() allocates and populates a struct mdinfo, however the code
forgot to free it again, before dropping the reference to the pointer.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: goto release if Manage_subdevs failed
Guoqing Jiang [Tue, 22 Mar 2016 09:03:44 +0000 (17:03 +0800)] 
Grow: goto release if Manage_subdevs failed

If failure happened when add disk to array
by grow mode, need to goto release instead
of continue the reshape.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: analyse_change add notification about only 2-device can be convert from RAID1...
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>
4 years agosuper-intel: Simplify for() loop in ahci_enumerate_ports
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).

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper-intel: Make print_vmd_attached_devs() return int again
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.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: close fd earlier to avoid "cannot get excl access" when stopping
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.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoFix regression during add devices
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>
4 years agoddf: use 64bit 'size', not 32bit 'info->size' for create.
NeilBrown [Thu, 10 Mar 2016 07:06:59 +0000 (18:06 +1100)] 
ddf: use 64bit 'size', not 32bit 'info->size' for create.

The 'size' field of mdu_disk_info_t is 32bit and should not be used
except for legacy ioctls.  super-ddf got this wrong :-(

This change makes it possible to create ddf arrays which used more than
2TB of each device.

Reported-by: Dan Russell <dpr@aol.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper-intel: Make print_found_intel_controllers() return void
Jes Sorensen [Wed, 9 Mar 2016 16:25:16 +0000 (11:25 -0500)] 
super-intel: Make print_found_intel_controllers() return void

The return value from print_found_intel_controllers() is never used,
so lets make it return void.

Reported-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: Fix potential buffer overflows when copying cluster_name
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>
4 years agoManage: Manage_subdevs() fix file descriptor leak
Jes Sorensen [Mon, 7 Mar 2016 18:53:43 +0000 (13:53 -0500)] 
Manage: Manage_subdevs() fix file descriptor leak

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agobitmap: Fix resource leak in bitmap_file_open()
Jes Sorensen [Mon, 7 Mar 2016 18:48:19 +0000 (13:48 -0500)] 
bitmap: Fix resource leak in bitmap_file_open()

The code would leak 'fd' if locate_bitmap() failed.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years ago{platform,super}-intel: Fix two resource leaks
Jes Sorensen [Mon, 7 Mar 2016 17:33:49 +0000 (12:33 -0500)] 
{platform,super}-intel: Fix two resource leaks

The code did not free 'dir' allocated by opendir(). An additional
benefit is that this simplifies the for() loops.

Fixes: 60f0f54d ("IMSM: Add support for VMD")
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Grow_addbitmap(): Add check to quiet down static code checkers
Jes Sorensen [Fri, 4 Mar 2016 21:49:38 +0000 (16:49 -0500)] 
Grow: Grow_addbitmap(): Add check to quiet down static code checkers

Grow_addbitmap() is only ever called with s->bitmap_file != NULL, but
not all static code checkers catch this. This adds a check to quiet
down the false positive warnings.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Grow_continue_command() remove dead code
Jes Sorensen [Fri, 4 Mar 2016 21:30:22 +0000 (16:30 -0500)] 
Grow: Grow_continue_command() remove dead code

All cases where fd2 is used are completed with a close(fd2), so there
is no need to set fd2 = -1 or check for it before exiting.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoload_sys(): Add a buffer size argument
Jes Sorensen [Fri, 4 Mar 2016 21:00:21 +0000 (16:00 -0500)] 
load_sys(): Add a buffer size argument

This adds a buffer size argument to load_sys(), rather than relying on
a hard coded buffer size. The old behavior was safe because we knew
the kernel would never return strings overrunning the buffers, however
it was ugly, and would cause code checking tools to spit out warnings.

This caused a Coverity warning over the read into
sra->sysfs_array_state which is only 20 bytes.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage: Manage_add(): Fix potential NULL pointer dereference
Jes Sorensen [Mon, 7 Mar 2016 16:49:03 +0000 (11:49 -0500)] 
Manage: Manage_add(): Fix potential NULL pointer dereference

sysfs_read() may return NULL, so we should check the validity of the
pointer before dereferencing it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoAssemble: Remove unnecesary NULL pointer checks when calling sysfs_free()
Jes Sorensen [Mon, 7 Mar 2016 17:09:12 +0000 (12:09 -0500)] 
Assemble: Remove unnecesary NULL pointer checks when calling sysfs_free()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoIncremental: Remove unnecesary NULL pointer checks when calling sysfs_free()
Jes Sorensen [Mon, 7 Mar 2016 17:07:45 +0000 (12:07 -0500)] 
Incremental: Remove unnecesary NULL pointer checks when calling sysfs_free()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoutil: Remove unnecesary NULL pointer checks when calling sysfs_free()
Jes Sorensen [Mon, 7 Mar 2016 17:04:58 +0000 (12:04 -0500)] 
util: Remove unnecesary NULL pointer checks when calling sysfs_free()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage: Remove unnecessary NULL pointer checks
Jes Sorensen [Mon, 7 Mar 2016 16:54:33 +0000 (11:54 -0500)] 
Manage: Remove unnecessary NULL pointer checks

sysfs_free() handles NULL pointers, so remove superfluous NULL pointer
checks before calling it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoRemove dead code about LKF_CONVERT flag
Guoqing Jiang [Mon, 7 Mar 2016 09:31:03 +0000 (17:31 +0800)] 
Remove dead code about LKF_CONVERT flag

Since flags is only set as LKF_NOQUEUE, the code
with LKF_CONVERT flag should be delete.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoFix wrong bitmap output for cluster raid
Guoqing Jiang [Mon, 7 Mar 2016 09:31:02 +0000 (17:31 +0800)] 
Fix wrong bitmap output for cluster raid

For cluster raid, we need to displays bitmap related
contents from different bitmaps which are based on node
num. So bitmap_file_open and locate_bitmap are changed a
little bit for the purpose.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Fixes: b98043a2f8 ("Show all bitmaps while examining bitmap")
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper-intel: ensure suspended region is removed when reshape completes.
NeilBrown [Thu, 18 Feb 2016 04:53:32 +0000 (15:53 +1100)] 
super-intel: ensure suspended region is removed when reshape completes.

A recent commit removed a call to abort_reshape() when IMSM reshape
completed.  An unanticipated result of this is that the suspended
region is not cleared as it should be.
So after a reshape, a region of the array will cause all IO to block.

Re-instate the required updates to suspend_{lo,hi} coped from
abort_reshape().

This is caught (sometimes) by the test suite.

Also fix a couple of typos found while exploring the code.

Reported-by: Ken Moffat <zarniwhoop@ntlworld.com>
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Fixes: 2139b03c2080 ("imsm: don't call abort_reshape() in imsm_manage_reshape()")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoGrow: Add documentation to abort_reshape() for suspend_{lo,hi} setting
Jes Sorensen [Mon, 22 Feb 2016 14:43:43 +0000 (09:43 -0500)] 
Grow: Add documentation to abort_reshape() for suspend_{lo,hi} setting

Add documentation for quirky reset procedure for resetting suspended
region range.

Suggested-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoManage.c: Only issue change events for kernels older than 2.6.28
Jes Sorensen [Tue, 16 Feb 2016 21:58:36 +0000 (16:58 -0500)] 
Manage.c: Only issue change events for kernels older than 2.6.28

2.6.28+ kernels handle this themselves and issuing the event here can
cause a race.

Reported-by: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Suggested-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agomdadm.h: rename bswap macros to avoid clash with uClibc definitions
Jes Sorensen [Wed, 10 Feb 2016 19:15:38 +0000 (14:15 -0500)] 
mdadm.h: rename bswap macros to avoid clash with uClibc definitions

uClibc exposes it's own version of bswap_<X> macros. Rather than
pulling in random macros by change, rename the mdadm ones to make sure
we know what we are getting.

Reported-by: "Maxin B. John" <maxin.john@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoutil.c: include poll.h instead of sys/poll.h
Maxin B. John [Fri, 5 Feb 2016 22:28:16 +0000 (00:28 +0200)] 
util.c: include poll.h instead of sys/poll.h

This fixes a compile warning when building with musl:

 In file included from util.c:27:0:
 |
 qemux86-64/usr/include/sys/poll.h:1:2:
 error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
 [-Werror=cpp]
 |  #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
 |   ^

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoMakefile: make the CC definition conditional
Maxin B. John [Mon, 8 Feb 2016 09:59:29 +0000 (11:59 +0200)] 
Makefile: make the CC definition conditional

By hardcoding CC's definition in the Makefile, all the external gcc
parameters set by tune settings are lost. This causes compile failure
with x32 toolchain

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoFix some type comparison problems
Xiao Ni [Sat, 6 Feb 2016 01:18:41 +0000 (09:18 +0800)] 
Fix some type comparison problems

As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
timestamps will overflow in the year 2038. It already changed the
utime and ctime in struct mdu_array_info_s from int to unsigned
int. So we need to change the values that compared with them to
unsigned int too.

Signed-off-by : Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agosuper1: Fix bblog_size accesses on big-ending machines.
NeilBrown [Fri, 29 Jan 2016 01:35:33 +0000 (12:35 +1100)] 
super1: Fix bblog_size accesses on big-ending machines.

bblog_size is 16bit so using le32_to_cpu on it is not wise
and leads to errors on big-endian machines.
Change all such calls to use le16.

Bug was introduced in mdadm-3.3

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
4 years agoRelease mdadm-3.4 mdadm-3.4
NeilBrown [Thu, 28 Jan 2016 02:34:13 +0000 (13:34 +1100)] 
Release mdadm-3.4

My last release!

Signed-off-by: NeilBrown <neilb@suse.com>
4 years agoAssorted fixed for a "make everything" build
NeilBrown [Thu, 28 Jan 2016 02:28:58 +0000 (13:28 +1100)] 
Assorted fixed for a "make everything" build

Signed-off-by: NeilBrown <neilb@suse.com>
4 years agosuper1: allow reshape that hasn't really started to be reverted.
NeilBrown [Thu, 28 Jan 2016 01:57:08 +0000 (12:57 +1100)] 
super1: allow reshape that hasn't really started to be reverted.

A simple revert doesn't work here because the reshape_position is
in the critical section.
The best approach is to let the reshape progress a bit and then
go backwards.
If that isn't possible, assembling with --update=revert-reshape and
--invalid-backup should work.

Reported-by-tested-by: George Rapp <george.rapp@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agosuper0: Fix reporting of devices between 2GB and 4GB
NeilBrown [Thu, 28 Jan 2016 00:57:54 +0000 (11:57 +1100)] 
super0: Fix reporting of devices between 2GB and 4GB

v0.90 metadata can handle devices between 2GB and 4GB, but we need
to treat the 'size' and unsigned.  In a couple of places we don't.

URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809447
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agosystemd/mdadm-last-resort: add Conflicts to .service file.
NeilBrown [Thu, 28 Jan 2016 00:45:53 +0000 (11:45 +1100)] 
systemd/mdadm-last-resort: add Conflicts to .service file.

It seems that having the Conflicts in the .timer file is not sufficient.
Sometimes it works, but if the timer gets requested after the conflicting
block device appears (or was it "before" ...) the timer is not aborted.

Having the Conflicts in both files seems to work reliably.

URL: https://bugzilla.suse.com/show_bug.cgi?id=853944
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agosuper1: fix calculation of space_before
NeilBrown [Thu, 28 Jan 2016 00:44:27 +0000 (11:44 +1100)] 
super1: fix calculation of space_before

This code was meant to update 'earliest' but clearly never doesn't.

This bug would only affect an array with a very large bitmap so it is unlikely
to be significant.

Signed-off-by: NeilBrown <neilb@suse.com>
4 years agoutil: fix wrong return value of cluster_get_dlmlock
Guoqing Jiang [Wed, 20 Jan 2016 08:21:25 +0000 (16:21 +0800)] 
util: fix wrong return value of cluster_get_dlmlock

Actually lksb.sb_status means that a node got the lock
or not instead of the return value of dlm_lock.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
4 years agoAdd casts for the addr arg of connect and bind
Khem Raj [Thu, 14 Jan 2016 06:32:39 +0000 (22:32 -0800)] 
Add casts for the addr arg of connect and bind

glibc allows the addr arg to connect and socket to be any of a number
of 'sockaddr_*' types, but musl requires 'const struct sockaddr *'
which is in line with open group specs.  So add casts to allow
compilation with musl.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agoDefine _POSIX_C_SOURCE if undefined
Khem Raj [Thu, 14 Jan 2016 06:32:38 +0000 (22:32 -0800)] 
Define _POSIX_C_SOURCE if undefined

config.c uses _POSIX_C_SOURCE which is defined in features.h when
glibc/uclibc is used, but isn't defined when musl is used.
So provide a reasonable default.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agoCreate: minor fix when adding a journal device
NeilBrown [Thu, 14 Jan 2016 03:09:57 +0000 (14:09 +1100)] 
Create: minor fix when adding a journal device

The check of "is there a filesystem here" is still appropriate for a
journal device.

Also set active_disks correctly - even though it is ignored.

Signed-off-by: NeilBrown <neilb@suse.com>
4 years agoCreate: fix regression in setting raid_disk
NeilBrown [Thu, 14 Jan 2016 02:22:17 +0000 (13:22 +1100)] 
Create: fix regression in setting raid_disk

Recent commit caused 'missing' declarations to not be handled correctly.

Fixes: cc1799c3ddc9 ("Enable create array with write journal (--write-journal DEVICE).")
Signed-off-by: NeilBrown <neilb@suse.com>
4 years agorestripe: fix compilation of "make test"
NeilBrown [Tue, 12 Jan 2016 23:01:02 +0000 (10:01 +1100)] 
restripe: fix compilation of "make test"

Signed-off-by: NeilBrown <neilb@suse.com>