The patch fixed the issue with Slider's hotplug disk.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch fixes a problem when formatting multiple disks, where either
another instance of iprconfig or iprinit or some similar tool ends up
calling evaluate_device before the issuing iprconfig does, resulting in
formatted devices that are not flagged as known zeroed. This adds some
locking around this function to ensure that does not happen.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The find_multipath_jbod is intended to return the alternate path
for the same device in a multipath configuration. However, it was
simply returning the first device that matched the device_id which
may have been the same device as the function parameter. This fixes
some issues and errors that can be seen when formatting JBOD disks.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Ensure the known zeroed state gets saved in the adapter following
a format unit command from the command line.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Since newer firmware versions now support tracking of the known zeroed state
for AF DASD disks, we don't need to warn the user about exiting iprconfig
when there are known zeroed disks if the adapter has this support.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch fixes some issues related to disk formatting. First,
it queries the disk to determine the optimal timeout to use for
a format command. This fixes format timeout issues on very large
capacity disks. Second, this also fixes up the 5xx/4k sector
size handling to ensure we don't end up mistakenly reformatting
drives to the wrong block size. This was primarily an issue
for drives that ended up in medium format corrupt and the subsequent
format then did the wrong thing.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Fix a possible format timeout issue for large disks on little endian systems.
We need to byte swap the 2 byte timeout field.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Display the /dev/sr device name for optical devices.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Enhance iprsos to collect some missing log files.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
When formatting a JBOD disk to AF, we unbind the /dev/sd
device nodes prior to starting the format in order to
avoid strange errors from cropping up. Additionally, we
also flush the unused multipath device maps for the same
reason. When we delete a RAID array, although delete the
/dev/sd device nodes prior to deleting the RAID array,
we weren't flushing the unused multipaths, so let's do that.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
SPL-4 defines a couple of higher values for the negotiated link rates
that were not defined in iprutils, causing us to display the default
value "Enabled" for link rates higher than 6.0Gbps in
query-path-details. This was found when working with the drawer ESLS.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The iprutils init.d scripts require the redhat-lsb on RHEL 6 in order
to function. Add this as a dependency.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Some new external drawers like ESLS have an internal clock, used by the
internal microcode. This patch enables iprinit to configure the clock
at boot time.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch added maximum queue depth in GUI when creating an array. Also
fixed some issues in query-qdepth and set-qdepth.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
When user passed 0x0 to old firmwares, rebuild rate would be set to the
implementation default value, defined by SIS, and any further read to
Mode Page 0x24 would display 0x0 in the Rebuild Rate field. Newer
firmwares, on the other hand, will correctly set the rebuild rate to the
implementation defined value, but the Mode Page field will display the
configured value, instead of 0x0. This causes iprutils to believe the
new configuration has failed, and error out.
The Implementation defined value used by every IPR adapter out there is
the minimum rebuild rate possible, 2/16, which translates to 0x2 in the
Mode page field. This patch gives iprutils the notion of the minimum
rebuild rate, and supports this scenario, so we don't fail when the user
requests a rebuild rate of 0.
To avoid confusing the user, we also make the values go from 10 to 100
instead of 0-100. If the user wants to enable the default setting,
instead of typing 0, he needs to use 'default'.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Some new enclosures, like ESLS only supports a limited buffer of 4k
bytes during SCSI Write Buffer calls. This means that doing a single
Write Buffer with mode 0Eh to download a large microcode will fail with
an Illegal Request. This patch adds a fallback mode to the Write Buffer
command in iprlib, allowing it to limit the buffer block size to 4K, in
case the single full write fails. If the device supports large buffers,
behavior remains unchanged, and iprlib can only issue a single write.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The use of gzclose_r() may break some builds depending on the version of zlib
that is being used. Since that function is identical to gzclose() apart from
some differences in static code linkage, we can swap them without any changes to
program behaviour.
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
When I pushed commit 855e7fd ("iprutils: Enable editor choice for new log system")
I had to manually merge them and ended up missing a couple of files which didn't get
pushed. This fixes that up.
Reported-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Although not usual, systemd binaries could be somewhere else other than
/usr/bin. This patch just remove this hard coded dependency.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
scsi_dev_data->device_id is a u64, so should be scanned with %llX rather
than %lX. On 32-bit big-endian systems I believe this will scan the
device_id into the wrong half of the 64-bit value.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Support force-reload options, which is useful and it is required be by
Debian policy.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Fix up a couple of possible segfaults in the new error log
parsing code that could occur if iprconfig is run by a user that
does not have read access to the logs.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Introducing a new wrapper function in iprconfig that invokes an editor
chosen by the user for log viewing.
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This commit rewrites some functions in iprconfig that are used to
display log information to the user. We now use standard C code instead
of system() calls and other OS utilities like grep. To view the
requested log info, the less pager is invoked with the environment
variable LESSSECURE set to 1 to prevent arbitrary command execution.
This commit also introduces a zlib depency to iprutils. This is needed
so that we can seamlessly work with compressed and uncompressed log files.
Changes since v1:
- moved invoke-pager() to iprconfig.c
- DEFAULT_EDITOR doesn't use an absolute path
- renamed some variables to make code more intelligible
- added a new entry to screen_status[] in iprconfig.h
- substituted return values with semantic literals from iprconfig.h
- added missing free() because of tmp_log
- fixed static build
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
iprconfig man page requires an IOA to be passed to query-raid-create and
query-raid-delete. Right now, iprconfig doesn't enforce it, allowing
disk devices to be passed as parameters, which is confusing. I found
that when playing with raid initialization code. Let's fix it.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Detect when a RAID is going through initialization process after
creation to display the progress in get_status. Now, the 'initializing'
state will be shown in 'show-config', for instance when creating a RAID
0 from a device assumed to be non-zeroed, it will show as "X%
Initializing" during DIF initialization.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The Array Rebuild Rate parameter was only getting read from Mode Page
0x24 for dual initiator adapters, which caused iprconfig to display the
wrong rate value for a single adapter setup. This patch fixes the issue,
by fetching this value for every IOA that supports page 0x24,
independent of the current IOA setup.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Explain in the man page that iprutils might not set the exact value when
configuring the rebuild rate. Instead, it will convert the percentage
value provided by the user to a integer value in the range 0-15 before
writing to the adapter. This means, that we only approximate to the
rate requested by the user and the return of 'query-array-rebuild-rate'
may not be the exact value previously passed to
'set-array-rebuild-rate'.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If you put a JBOD 4K disk in an IOA that doesn't support 4K AF devices
it will work, but iprconfig will not recognize it as
IPR_BLK_DEV_CLASS_4K. In this case, when we try to format it for RAID,
iprconfig will try to set the block size as 512, which will fail the
format command silently. This patch makes sure IPR_BLK_DEV_CLASS_4K is
set for every 4K device, despite the IOA supporting 4K AF devices or
not. Then, the verification for it in format_for_raid():13852 will
actually work, and we will abort the format earlier with an error
message, instead of failing silently.
Setting IPR_BLK_DEV_CLASS_4K for every device should not be an issue,
since in every other place it is referenced, we also check for
dev->ioa->support_4k and ipr_is_af_dasd_device().
This also adds a '\n' at the end of the error message cited above, to
improve readability.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If there's a device without scsi_dev_data in the list of devices,
iprconfig might segfault when formatting a device for an array. This
prevents this scenario.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
<bits/sockaddr.h> is an internal C library header, which is not
guaranteed to be available in all C libraries, so it shouldn't be
included, otherwise iprutils cannot be built with musl.
<limits.h> is needed to get the definition of PATH_MAX.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
In certain configurations of uClibc, the matherr() function may not be
provided by the C library, which makes the current configure.ac check
for libm fail. However, iprutils does not use matherr(), so using this
function for the test makes little sense.
This patch adjusts configure.ac to test for pow() instead, which is
actually used by iprutils, and more commonly available, including in
uClibc.
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
... since we don't have any translation.
Based on the former patch by Jeremy Kerr.
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
[Thomas: adapt to the new autotools build system.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
When query-raid-levels-migrate is issued to a secondary (Non-optimized)
device on a dual adapter configuration, we send a Query Array
configuration with the Array Migrate Query option, which ends up
retrieving every RAID level supported by the adapter instead of only
returning the possible migration level candidates.
This patch blocks query-raid-levels-migrate for RAIDS that aren't ready
for migration, which avoids displaying impossible level candidates for
secondary devices and better complies with the behavior of the ncurses
interface.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Since commit 0b693bd29c (iprutils: Unbind device before JBOD -> AF
formatting), multipath and /dev/sd device removal is done by the
binding and unbinding operations prior to formatting. We can now remove
the manual 'rm' calls in ipr_format_unit() and just flush unused multipath maps.
This patch also fixes a missing function prototype for the aforementioned commit.
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If the iprinit service is enabled but there are no ipr adapters
on the system and therefore the ipr driver is not loaded, let's not
log any messages in the log telling the user they need to manually
run iprinit to ensure their RAID adapters are running optimally.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This adds a new top level menu to display some statistics of devices.
If the adapter is an AF DASD we show the output of show-perf and if it
is a RI SSD, we show the same output as ssd-report.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Refactor the top level menu, creating a sub-menu for devices
configuration. Internals is also reworked to reduce code duplication.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>