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

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