Blame SOURCES/0001-Fix-dev-null-redirect-mistakes.patch

a6e0dd
From 9d2adc90e76e76c07ee63b2b2868579188fec1a7 Mon Sep 17 00:00:00 2001
a6e0dd
From: David Sommerseth <davids@redhat.com>
a6e0dd
Date: Fri, 15 Apr 2016 23:53:18 +0200
a6e0dd
Subject: [PATCH] Fix /dev/null redirect mistakes
a6e0dd
a6e0dd
Several places there are attempts to redirect to /dev/null, but
a6e0dd
missing the redirect operator.  This causes also /dev/null to be
a6e0dd
deleted when running 'rescan-scsi-bus.sh -u'.
a6e0dd
a6e0dd
Patch based on proposed patches in Red Hat bugzilla 1245302
a6e0dd
---
a6e0dd
 scripts/rescan-scsi-bus.sh | 28 ++++++++++++++--------------
a6e0dd
 1 file changed, 14 insertions(+), 14 deletions(-)
a6e0dd
a6e0dd
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
a6e0dd
index 7ec9323..4468cd3 100644
a6e0dd
--- a/scripts/rescan-scsi-bus.sh
a6e0dd
+++ b/scripts/rescan-scsi-bus.sh
a6e0dd
@@ -234,7 +234,7 @@ testonline ()
a6e0dd
   if test ! -x /usr/bin/sg_turs; then return 0; fi
a6e0dd
   sgdevice
a6e0dd
   if test -z "$SGDEV"; then return 0; fi
a6e0dd
-  sg_turs /dev/$SGDEV >/dev/null 2>&1
a6e0dd
+  sg_turs /dev/$SGDEV &>/dev/null
a6e0dd
   RC=$?
a6e0dd
   # Handle in progress of becoming ready and unit attention -- wait at max 11s
a6e0dd
   declare -i ctr=0
a6e0dd
@@ -246,7 +246,7 @@ testonline ()
a6e0dd
     if test $RC = 2 -a "$RMB" != "1"; then echo -n "."; let LN+=1; sleep 1
a6e0dd
     else usleep 20000; fi
a6e0dd
     let ctr+=1
a6e0dd
-    sg_turs /dev/$SGDEV >/dev/null 2>&1
a6e0dd
+    sg_turs /dev/$SGDEV &>/dev/null
a6e0dd
     RC=$?
a6e0dd
   done
a6e0dd
   if test $ctr != 0; then white_out; fi
a6e0dd
@@ -703,7 +703,7 @@ findremapped()
a6e0dd
   # Trigger udev to update the info
a6e0dd
   echo -n "Triggering udev to update device information... "
a6e0dd
   /sbin/udevadm trigger
a6e0dd
-  udevadm_settle 2&>1 /dev/null
a6e0dd
+  udevadm_settle &>/dev/null
a6e0dd
   echo "Done"
a6e0dd
 
a6e0dd
   # See what changed and reload the respective multipath device if applicable
a6e0dd
@@ -724,12 +724,12 @@ findremapped()
a6e0dd
       incrchgd "$hctl"
a6e0dd
     fi
a6e0dd
   done < $tmpfile
a6e0dd
-  rm $tmpfile 2&>1 /dev/null
a6e0dd
+  rm $tmpfile &>/dev/null
a6e0dd
 
a6e0dd
   if test -n "$mp_enable" -a -n "$mpaths" ; then
a6e0dd
     echo "Updating multipath device mappings"
a6e0dd
     flushmpaths
a6e0dd
-    $MULTIPATH | grep "create:" 2> /dev/null #2&>1 /dev/null
a6e0dd
+    $MULTIPATH | grep "create:" 2> /dev/null
a6e0dd
   fi
a6e0dd
 }
a6e0dd
 
a6e0dd
@@ -831,14 +831,14 @@ reloadmpaths()
a6e0dd
 
a6e0dd
   if [ "$1" = "1" ] ; then
a6e0dd
     echo "Reloading all multipath devices"
a6e0dd
-    $MULTIPATH -r 2&>1 /dev/null
a6e0dd
+    $MULTIPATH -r &>/dev/null
a6e0dd
     return
a6e0dd
   fi
a6e0dd
 
a6e0dd
   # Reload the multipath devices
a6e0dd
   for mpath in $mpaths ; do
a6e0dd
     echo "Reloading multipath device $mpath"
a6e0dd
-    $MULTIPATH -r $mpath 2&>1 /dev/null
a6e0dd
+    $MULTIPATH -r $mpath &>/dev/null
a6e0dd
   done
a6e0dd
 }
a6e0dd
 
a6e0dd
@@ -851,9 +851,9 @@ flushmpaths()
a6e0dd
       num=$($DMSETUP status $mpath | awk 'BEGIN{RS=" ";active=0}/[0-9]+:[0-9]+/{dev=1}/A/{if (dev == 1) active++; dev=0} END{ print active }')
a6e0dd
       if [ $num -eq 0 ] ; then
a6e0dd
         echo -n "Flushing multipath device $mpath...  "
a6e0dd
-        $DMSETUP message $mpath 0 fail_if_no_path 2&>1 /dev/null
a6e0dd
-        $MULTIPATH -f $mpath 2&>1 /dev/null
a6e0dd
-        $DMSETUP status $mpath 2&>1 /dev/null
a6e0dd
+        $DMSETUP message $mpath 0 fail_if_no_path &>/dev/null
a6e0dd
+        $MULTIPATH -f $mpath &>/dev/null
a6e0dd
+        $DMSETUP status $mpath &>/dev/null
a6e0dd
         if test "$?" = "1" ; then
a6e0dd
           echo "Done"
a6e0dd
         else
a6e0dd
@@ -866,9 +866,9 @@ flushmpaths()
a6e0dd
   # Flush all the devs specified in $mpaths
a6e0dd
   for mpath in $mpaths ; do
a6e0dd
     echo -n "Flushing multipath device $mpath...  "
a6e0dd
-    $DMSETUP message $mpath 0 fail_if_no_path 2&>1 /dev/null
a6e0dd
-    $MULTIPATH -f $mpath 2&>1 /dev/null
a6e0dd
-    $DMSETUP status $mpath 2&>1 /dev/null
a6e0dd
+    $DMSETUP message $mpath 0 fail_if_no_path &>/dev/null
a6e0dd
+    $MULTIPATH -f $mpath &>/dev/null
a6e0dd
+    $DMSETUP status $mpath &>/dev/null
a6e0dd
     if test "$?" = "1" ; then
a6e0dd
       echo "Done"
a6e0dd
     else
a6e0dd
@@ -967,7 +967,7 @@ if test ! -d /sys/class/scsi_host/ -a ! -d /proc/scsi/; then
a6e0dd
 fi	
a6e0dd
 
a6e0dd
 # Make sure sg is there
a6e0dd
-modprobe sg >/dev/null 2>&1
a6e0dd
+modprobe sg &>/dev/null
a6e0dd
 
a6e0dd
 if test -x /usr/bin/sg_inq; then
a6e0dd
   sg_version=$(sg_inq -V 2>&1 | cut -d " " -f 3)
a6e0dd
-- 
a6e0dd
1.8.3.1
a6e0dd