Bug 633469

Summary: [6.1 FEAT] Enhance cio_ignore usage in scripts using new handler for pending work - installer part
Product: Red Hat Enterprise Linux 6 Reporter: IBM Bug Proxy <bugproxy>
Component: anacondaAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: dhorak, gmuelas, jjarvis, jstodola, maier, mgrf, nobody+PNT0273897, rwilliam, sbest
Target Milestone: betaKeywords: FutureFeature, Reopened
Target Release: 6.1   
Hardware: s390x   
OS: All   
Whiteboard:
Fixed In Version: anaconda-13.21.111-1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 12:50:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 631517, 631527, 633356    
Bug Blocks: 538808, 580566, 633862, 647893    

Description IBM Bug Proxy 2010-09-13 19:42:55 UTC
1. Feature Overview:
Feature Id: [67040]
a. Name of Feature: [6.1 FEAT] Enhance cio_ignore usage in scripts using new handler for pending
work - installer part
b. Feature Description
This feature requests to enhance the cio_ignore usage in installer by taking advantage of the new
cio_ignore handler to wait for cio pending work.

2. Feature Details:
Sponsor: LTC zSeries BOE
Architectures:  zSeries - 64 native, 

Arch Specificity: purely arch specific code
Affects Kernel Modules: Field does not exist
Delivery Mechanism: LDP Deliverable
Category: other
Request Type: Installer - Enhancement from Distributor
d. Upstream Acceptance: Field does not exist
Sponsor Priority P1
f. Severity: ship issue
IBM Confidential: No
Code Contribution: 3rd party code
g. Component Version Target:---

3. Business Case
This feature will avoid running into possible race condition, making the code more stable. Resulting
on less service cost and better customer satisfaction.

4. Primary contact at Red Hat:
John Jarvis jjarvis

5. Primary contacts at Partner:
Project Management Contact:
Hans-Georg Markgraf, mgrf.com

Technical contact(s):
Gonzalo Muelas Serrano, gmuelas.com

Comment 2 Chris Lumens 2010-09-13 20:00:18 UTC
And what are the changes required to implement this?

Comment 3 Gonzalo Muelas Serrano 2010-09-14 09:07:42 UTC
Hello,
the changes needed to implement this feature are to use the kernel infrastructure (provided by RH Bug 631517) and the tool (provided by RH Bug 631527) in the installer to solve the issues workarounded with timeouts in RHEL 6.0. For more deatils, please read RH Bug 533494 comments #15 through #35, and get in contact with Dan Horak.

Comment 4 Steffen Maier 2010-09-14 12:53:16 UTC
Very simplified speaking this feature only exists of inserting a write into a sysfs file to reliably block right after each dynamic free of devices from cio_ignore (and before the already existing udevadm settle) inside linuxrc.s390. Should only be four occurrences.

The cio_ignore handling in storage/zfcp.py already delegates to zfcp_cio_free (aka device_cio_free) of s390utils and works transparently as soon as s390utils are updated in RH bug 633356.

Comment 5 IBM Bug Proxy 2010-10-04 16:35:09 UTC
------- Comment From rsisk.com 2010-10-04 10:42 EDT-------
Code Upstream Status: No Code Required

Comment 6 IBM Bug Proxy 2010-11-30 10:21:18 UTC
------- Comment From mgrf.com 2010-11-30 05:11 EDT-------
Close this feature request as duplicate
to   66875 - RHBZ 631527 -  [6.1 FEAT] Provide userspace handle to wait for cio
pending work - userspace

The functionality could be implemented into s390tools (s390utils) only and get referred to during install and boot.
The calls from installer and scripts already exist with RHEL6  (6.0 FEAT cio_ignore...)  feature request.
.
So nothing to implement for the installer anymore.

*** This bug has been marked as a duplicate of bug 66875 ***

Comment 7 David Cantrell 2010-11-30 14:34:36 UTC

*** This bug has been marked as a duplicate of bug 631527 ***

Comment 9 Georg Markgraf 2010-12-08 13:26:03 UTC
I was too fast closing this feature a DUP because there is still work to be done in linuxrc 

As mentioned by Steffen Maier in Comment #4 (RHBZ) (#7 LTC BZ) 

In anaconda's rhel6-branch, there are still the following usages of cio_ignore WITHOUT the necessary cio_settle in loader/linuxrc.s390. 

Those MUST be adapted to call the corresponding user space tool in order to transparently handle dynamic freeing from cio_ignore.


# read file from CMS and write it to /tmp                                       
function readcmsfile() # $1=dasdport $2=filename                                
{
    local dev
    if [ $# -ne 2 ]; then return; fi
    # precondition: udevd created dasda block device node                       
    if ! sysecho /proc/cio_ignore "free $1"; then
        echo $"DASD $1 could not be cleared from device blacklist"
        return 1
    fi
    # /proc/cio_ignore won't block on freeing devices until resensing           
    # has been completed, so wait until the udev event queue depletes           
    # (without udevadm settle we could wait 2 seconds unconditionally)          
    #debug ls -laF /dev/.udev                                                   
    udevadm settle
    # even though the device might now be online, some of its                   
    # sysfs attributes might not yet be available                               
    sleep 1

function dialog_network_table() {
...
        if [ "$choice" = "c" ]; then
            echo $"Clearing device blacklist..."
            if sysecho /proc/cio_ignore "free all"; then
                cio_wc_bytes=0
                # /proc/cio_ignore won't block on freeing devices               
                # until resensing has been completed, so wait until             
                # the udev event queue depletes.                                
                # This may take a long time so we show "progress":              
                #( while true; do echo -n "."; sleep 3; done ) &                
                #local childpid=$!                                              
                #debug ls -laF /dev/.udev                                       
                udevadm settle

function semantic_check_subchannels() {
...
        if [ ! -d "$dev_p" -a "$cio_wc_bytes" != "0" ]; then
            # - try to free from /proc/cio_ignore if they don't exist           
            echo $"Device $devbusid not present, trying to clear from
blacklist\
 and resense..."
            if sysecho /proc/cio_ignore "free $devbusid"; then
                # /proc/cio_ignore won't block on freeing devices               
                # until resensing has been completed, so wait until             
                # the udev event queue depletes (without udevadm settle we      
                # could wait 2 seconds unconditionally)                         
                #debug ls -laF /dev/.udev                                       
                udevadm settle
                # even though the device might now be online, some of its       
                # sysfs attributes (e.g. cutype) might not yet be available     
                sleep 1

### MAIN ###
...
                    if sysecho /proc/cio_ignore "free $CD_DEVICE"; then         
                        udevadm settle                                          
                        # even though device might now be online, some of its   
                        # sysfs attributes might not yet be available           
                        sleep 1

Comment 10 Gonzalo Muelas Serrano 2010-12-08 15:45:40 UTC
That is, there is some code in linuxrc which should be using the "*_cio_free" functions implemented in s390utils, which will get updated to use the new handler.

Comment 14 Jan Stodola 2011-04-05 12:16:41 UTC
There is still one place in linuxrc that is not fixed:

function semantic_check_subchannels() {
...
        if [ ! -d "$dev_p" -a "$cio_wc_bytes" != "0" ]; then
            # - try to free from /proc/cio_ignore if they don't exist
            echo $"Device $devbusid not present, trying to clear from blacklist and resense..."
            if sysecho /proc/cio_ignore "free $devbusid"; then
                # /proc/cio_ignore won't block on freeing devices
                # until resensing has been completed, so wait until
                # the udev event queue depletes (without udevadm settle we
                # could wait 2 seconds unconditionally)
                #debug ls -laF /dev/.udev
                udevadm settle
                # even though the device might now be online, some of its
                # sysfs attributes (e.g. cutype) might not yet be available
                sleep 1
            else
                echo $"Device $devbusid could not be cleared from device blacklist"
            fi
        fi
...

Tested with anaconda-13.21.108
Moving back to ASSIGNED

Comment 19 John Jarvis 2011-04-06 20:16:06 UTC
This fix is approved and planned for inclusion in snapshot 3.

Comment 20 Jan Stodola 2011-04-12 10:15:53 UTC
There is no direct write into /proc/cio_ignore in anaconda-13.21.111 source code, build RHEL6.1-20110406.0.

Moving to VERIFIED.

Comment 21 errata-xmlrpc 2011-05-19 12:50:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0530.html