Re: [PATCH 1/2] Use /sbin/dasd_cio_free to free blacklisted DASDs (#558881)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/27/2010 01:49 AM, David Cantrell wrote:
> Use the dasd_cio_free command to free blacklisted DASDs and block until
> they are available to set online and set other attributes.  We were just
> writing "free $DEVICE" to /proc/cio_ignore, but we lacked the wait loop
> to make sure the device showed up.  The /sbin/dasd_cio_free command does
> that for us, so we can just call that.
> 
> NOTE:  dasd_cio_free as currently written only reads a device list from
> /etc/dasd.conf.  It does not take command line options.  For beta 2,
> there is slated an update to s390utils to allow the *_cio_free commands
> to take in a command line argument specifying the device to tree.  Until
> that happens, we have to pass that information to dasd_cio_free via the
> /etc/dasd.conf file.

dasd_cio_free has two methods to wait for DASDs to be freed from the
device blacklist:
1) For dracut's new style rd_DASD, it uses /etc/dasd.conf
   with one device per line, the first column being the device bus ID.
2) For dracut's legacy rd_DASD_MOD, it uses whatever
   "modprobe --showconfig" returns for "options dasd_mod dasd=...".
   That's the syntax of the dasd_mod device driver modules option "dasd"
   which takes a list of device bus ID ranges including some options.
   A good place to put the dasd_mod device driver option is
   /etc/modprobe.d/dasd_mod.conf.

The syntax for linuxrc's DASD parm/conf file option is exactly
the syntax of the dasd_mod device driver module option "dasd".
Therefore, we should use method 2 for dasd_cio_free in linuxrc.

Additionally, with your solution, the user can run into multiple
timeouts of 60 seconds each. This happens if the user specified multiple
DASD ranges (often just one device bus ID per "range") in a list of
which some devices accidently do not exist. Calling dasd_cio_free
separately for each range in sequence does then run into the timeout for
for each range with non-existing devices. dasd_cio_free does have
support for reducing the timeout which can be simply exploited by also
using the rd_DASD_MOD style.

dasd_cio_free only needs to be called if there are any entries
in the blacklist. Otherwise there is nothing to wait for and we should
not even try.

User information that it'll try to free devices from the blacklist
which might take some time is also missing.

All this has already been stated in bug 558881 comment 19
including a pseudo patch for the suggested solution
(the difference being that the pseudo patch assumed
dasd_cio_free to take command line arguments, so it has to be
adapted to take the detour through /etc/modprobe.d/dasd_mod.conf).

Is there any particular reason to do it differently?

> ---
>  loader/linuxrc.s390  |    8 +++++---
>  scripts/upd-instroot |    1 +
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
> index e2ba469..454b02b 100644
> --- a/loader/linuxrc.s390
> +++ b/loader/linuxrc.s390
> @@ -2397,6 +2397,7 @@ function parse_dasd() {
>      [ "$1" = "-h" ] && handle=yes || unset handle
>      local dasditem
>      local allgood="yes"
> +    local dasdconf="/etc/dasd.conf"
>      while read dasditem; do
>          unset range features range lo hi rangegood \
>              attrs devno lodevno hidevno devbusid sys
> @@ -2466,12 +2467,12 @@ function parse_dasd() {
>                      esac
>                  fi
>                  if [ "$rangegood" = "yes" -a "$handle" = "yes" ]; then
> -                    if ! sysecho /proc/cio_ignore "free $range"; then
> +                    echo "$range" > $dasdconf
> +                    if ! dasd_cio_free; then
>                          echo $"Could not free DASD device $range from device blacklist"
>                          allgood="no"
> -                    else
> -                        udevadm settle
>                      fi
> +                    rm -f $dasdconf
>                  fi
>                  if [ "${features//*)/}" != "" ]; then
>                      if [ -z "$handle" ]; then
> @@ -2527,6 +2528,7 @@ function parse_dasd() {
>                  ;;
>          esac
>      done < <(echo $DASD | sed 's/,/\n/g')
> +    rm -f $dasdconf
>      if [ "$handle" = "yes" ]; then
>          udevadm settle
>          dasd_settle_all || return 1
> diff --git a/scripts/upd-instroot b/scripts/upd-instroot
> index 8250ea1..ca0fcce 100755
> --- a/scripts/upd-instroot
> +++ b/scripts/upd-instroot
> @@ -709,6 +709,7 @@ bin/uname
>  bin/vi
>  lib/modules/ibm
>  lib/security
> +sbin/*_cio_free
>  sbin/arp
>  sbin/cmsfscat
>  sbin/cmsfslst

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux