Skip to content

Commit 2fe7f4e

Browse files
committed
common/scsi_debug: ensure scsi_debug is loadable before loading it
Currently, _have_scsi_debug_group_number_stats() assumes that scsi_debug is loadable. This does not work when scsi_debug is built-in. Before loading scsi_debug in the function, ensure that scsi_debug is loadable. Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 1b6aea7 commit 2fe7f4e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

common/scsi_debug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ _scsi_debug_key_path() {
4949
_have_scsi_debug_group_number_stats() {
5050
local ret=0
5151

52+
_have_loadable_scsi_debug || return 1
53+
5254
modprobe -qr scsi_debug >&/dev/null
5355
modprobe -q scsi_debug delay=0 >&/dev/null
5456
if ! [[ -e ${SD_PSEUDO_PATH}/group_number_stats ]]; then

0 commit comments

Comments
 (0)