From 38e6b41c0c7e5de1bc1fefd721d638c296927581 Mon Sep 17 00:00:00 2001 From: Xunlei Pang Date: Mon, 24 Jul 2017 21:31:39 +0800 Subject: [PATCH] module-setup: suppress the early iscsi error messages Currently, we throw the error message at the very beginning, as a result on a pure-hardware(all-offload) iscsi machine with many iscsi partitions, we suffered from too much noise as follows: iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1 iscsiadm: No records found Unable to find iscsi record for /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2 kexec: loaded kdump kernel Starting kdump: [OK] There's no need to know the very early error messages, we can remove the error output which is actually normal for the pure hardware iscsi. As for unexpected errors, we kept the error outputs in the succeeding kdump_iscsi_get_rec_val() calls by not appending "2>/dev/null". Signed-off-by: Xunlei Pang Acked-by: Dave Young --- dracut-module-setup.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 8de9dbe..ae13337 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -545,11 +545,9 @@ kdump_setup_iscsi_device() { dinfo "Found iscsi component $1" - # Check once before getting explicit values, so we can output a decent - # error message. - - if ! /sbin/iscsiadm -m session -r ${path} >/dev/null ; then - derror "Unable to find iscsi record for $path" + # Check once before getting explicit values, so we can bail out early, + # e.g. in case of pure-hardware(all-offload) iscsi. + if ! /sbin/iscsiadm -m session -r ${path} &>/dev/null ; then return 1 fi