Skip to content

Commit

Permalink
ofpathname: skip devices with no devspec when coorelating FC OF paths
Browse files Browse the repository at this point in the history
When using ofpathname to find the logical device associated to a Fibre
Channel or Virtual Fibre Channel OF path an ERR_NO_SYSFS_DEVINFO error
can be returned if a device with no devspec attribute is in the list of
devices to cross reference.

If a device with no devspec is found simply skip it an continue the
for-loop device search.

Signed-off-by: Tyrel Datwyler <[email protected]>
  • Loading branch information
tyreld committed Jul 26, 2024
1 parent a67eb56 commit a560285
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/ofpathname
Original file line number Diff line number Diff line change
Expand Up @@ -1649,10 +1649,14 @@ of2l_vfc()
link=$PWD

local device_dir=${PWD##/*/}
goto_dir $PWD "devspec"
goto_dir $PWD "devspec" 0
if [[ $? -eq 1 ]]; then
continue;
fi
OF_PATH=`$CAT $PWD/devspec`

if [[ -z $OF_PATH ]]; then
err $ERR_NO_LOGDEV
err $ERR_NO_LOGDEV
fi

# Skip if this is not the correct FC port
Expand Down Expand Up @@ -1727,10 +1731,14 @@ of2l_fc()

cd $link
local device_dir=${PWD##/*/}
goto_dir $PWD "devspec"
goto_dir $PWD "devspec" 0
if [[ $? -eq 1 ]]; then
continue;
fi
OF_PATH=`$CAT devspec`

if [[ -z $OF_PATH ]]; then
err $ERR_NO_LOGDEV
err $ERR_NO_LOGDEV;
fi

# Skip if this is not the correct FC port
Expand Down

0 comments on commit a560285

Please sign in to comment.