check the existence of /sys/bus/ccwgroup/devices before trying to find online network device

Resolves: bz1977543
Upstream: Fedora
Conflict: None

commit 03f9b91351fcd245e8d9327c38de296f818ad115
Author: Coiby Xu <coxu@redhat.com>
Date:   Mon Jun 28 18:37:10 2021 +0800

    check the existence of /sys/bus/ccwgroup/devices before trying to find online network device

    /sys/bus/ccwgroup/devices doesn't exist for non-s390x machines which leads to
    the warning "find: '/sys/bus/ccwgroup/devices': No such file or directory".
    This warning can be eliminated by checking the existence of
    "/sys/bus/ccwgroup/devices" beforehand.

    Fixes: commit 7d472515688fb330eee76dac1c39ae628398f757
           ("Iterate /sys/bus/ccwgroup/devices to tell if we should set up rd.znet")

    Reported-by: Ruowen Qin <ruqin@redhat.com>
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1974618
    Signed-off-by: Coiby Xu <coxu@redhat.com>
    Acked-by: Kairui Song <kasong@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Coiby Xu 2021-06-30 09:20:09 +08:00 committed by Coiby Xu
parent 0fb7ca87a1
commit 3b4df2455b
1 changed files with 3 additions and 1 deletions

View File

@ -467,7 +467,9 @@ kdump_setup_vlan() {
find_online_znet_device() {
local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices"
local NETWORK_DEVICES d ifname ONLINE
NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR -type l)
[ ! -d "$CCWGROUPBUS_DEVICEDIR" ] && return
NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR)
for d in $NETWORK_DEVICES
do
read ONLINE < $d/online