Hello community, here is the log from the commit of package s390-tools checked in at Mon Nov 10 15:34:59 CET 2008. -------- --- arch/s390/s390-tools/s390-tools.changes 2008-11-06 15:38:25.000000000 +0100 +++ /mounts/work_src_done/STABLE/s390-tools/s390-tools.changes 2008-11-10 11:47:15.755397000 +0100 @@ -1,0 +2,5 @@ +Mon Nov 10 11:46:47 CET 2008 - hare@suse.de + +- Update zfcp_san_disc to check for WLUNs first (bnc#437633) + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ s390-tools.spec ++++++ --- /var/tmp/diff_new_pack.F11207/_old 2008-11-10 15:34:44.000000000 +0100 +++ /var/tmp/diff_new_pack.F11207/_new 2008-11-10 15:34:44.000000000 +0100 @@ -22,7 +22,7 @@ Url: http://www10.software.ibm.com/developerworks/opensource/linux390 Summary: S/390 tools like zipl and dasdfmt Version: 1.8.0 -Release: 13 +Release: 14 PreReq: %insserv_prereq %fillup_prereq License: GPL v2 or later Provides: s390utils:/sbin/dasdfmt @@ -257,6 +257,8 @@ /usr/lib/%{snmp}/agents/osasnmpd %changelog +* Mon Nov 10 2008 hare@suse.de +- Update zfcp_san_disc to check for WLUNs first (bnc#437633) * Thu Nov 06 2008 uli@suse.de - with all the udev red tape, we forgot to actually set the port number... (fate #304080) ++++++ zfcp_san_disc ++++++ --- /var/tmp/diff_new_pack.F11207/_old 2008-11-10 15:34:45.000000000 +0100 +++ /var/tmp/diff_new_pack.F11207/_new 2008-11-10 15:34:45.000000000 +0100 @@ -160,15 +160,26 @@ for loop in 1 2 3 4 5 ; do read status < /sys/bus/ccw/devices/$BUSID/status - [ "$status" != "0x00000004" ] && break; + (( $status & 0x10000000 )) && break; done read wwpn_status < /sys/bus/ccw/devices/$BUSID/status -if [ "$wwpn_status" == "0x00000004" ] ; then +if !(( $wwpn_status & 0x10000000 )) ; then echo_err "Adapter activation failed, status $wwpn_status" [ "$online" = 2 ] && echo 0 > /sys/bus/ccw/devices/$BUSID/online exit 3 fi +for host in /sys/bus/ccw/devices/$BUSID/host* ; do + if [ -d $host ] ; then + hba_num=${host##*host} + fi +done +if [ -z "$hba_num" ] ; then + echo_err "No SCSI host allocated" + [ "$online" = 2 ] && echo 0 > /sys/bus/ccw/devices/$BUSID/online + exit 3 +fi + if [ "$COMMAND" == "$LIST_WWPN" ] then for PRINT_WWPN in /sys/bus/ccw/devices/$BUSID/0x* @@ -193,45 +204,70 @@ if [ ! -d "${WWPN_DIR}" ] then - echo_err "Unable to add port $WWPN to Bus ID $BUSID" + echo_err "port $WWPN not found on zfcp $BUSID" [ "$online" = 2 ] && echo 0 > /sys/bus/ccw/devices/$BUSID/online exit 9 fi - # Activate LUN 0 - if [ ! -d $WWPN_DIR/0x0000000000000000 ] ; then - echo 0 > $WWPN_DIR/unit_add + # Activate WLUN + if [ ! -d $WWPN_DIR/0xc101000000000000 ] ; then + echo 0xc101000000000000 > $WWPN_DIR/unit_add activated=1 + + # Wait for udev to catch up + udevadm settle + + # Find corresponding sg device + sgdev=$(lsscsi -t -g $hba_num:-:-:- | sed -n "s/.* fc:$WWPN,.* \(\/dev\/sg.*\)/\1/p") + if [ -c "$sgdev" ] ; then + wlun=1 + else + echo 0xc101000000000000 > $WWPN_DIR/unit_remove + activated= + sgdev= + fi fi - ERR=0 - # Find corresponding sg device - for LUN_DIR in /sys/bus/ccw/devices/$BUSID/host*/rport*/target*/*:*:*:0 ; do - if [ ! -d $LUN_DIR ] ; then + if [ -z "$wlun" ] ; then + # Activate LUN 0 + if [ ! -d $WWPN_DIR/0x0000000000000000 ] ; then + echo 0 > $WWPN_DIR/unit_add + activated=1 + fi + + # Wait for udev to catch up + udevadm settle + + # Find corresponding sg device + sgdev=$(lsscsi -t -g $hba_num:-:-:- | sed -n "s/.* fc:$WWPN,.* \(\/dev\/sg.*\)/\1/p") + if [ ! -c "$sgdev" ] ; then echo_err "Unable to activate LUN 0" - LUN_DIR= + echo 0x0000000000000000 > $WWPN_DIR/unit_remove + activated= + sgdev= ERR=10 - elif [ ! -f $LUN_DIR/generic/dev ] ; then - echo_err "Unable to find LUN 0" - LUN_DIR= - ERR=11 - else - read devt < $LUN_DIR/generic/dev - sgnum=${devt##*:} - break fi - done - if [ "$sgnum" ] ; then - LUN_LIST=`sg_luns /dev/sg$sgnum | sed -n 's/^ \(.*\)/\1/p'` + fi + if [ "$sgdev" ] ; then + LUN_LIST=`sg_luns $sgdev | sed -n 's/^ \(.*\)/\1/p'` fi for LUN in $LUN_LIST ; do echo 0x$LUN done if [ "$activated" = 1 ] ; then - if [ -n "$LUN_DIR" ] ; then - echo 1 > $LUN_DIR/delete + if [ -n "$sgdev" ] ; then + sgnum=${sgdev#/dev/sg} + : deactivate /sys/class/scsi_generic/sg$sgnum/device/delete + echo 1 > /sys/class/scsi_generic/sg$sgnum/device/delete + udevadm settle + fi + if [ "$wlun" = 1 ] ; then + echo 0xc101000000000000 > $WWPN_DIR/unit_remove + wlun= + else + echo 0x0000000000000000 > $WWPN_DIR/unit_remove fi - echo 1 > $WWPN_DIR/unit_remove + activated= fi [ "$online" = 2 ] && echo 0 > /sys/bus/ccw/devices/$BUSID/online ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org