[Pkg-iscsi-maintainers] Bug#745708: open-iscsi: umountiscsi.sh prematurely exits when encountering targets without block devices

Sammy Atmadja sammy at transtrend.com
Fri Apr 25 06:18:58 UTC 2014


> Patch looks good. But just a quick question. If the specific target
> session does not have any block device, wouldn't BLOCK_FILE be empty
> and thus not fall under the if condition ?

BLOCK_FILE will not be empty, and *that* is exactly the root of the 
problem. When the wildcards in the following line:
    for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
do not match anything, BLOCK_FILE will be: 
    $SESSION_DIR/target*/*\:*/block/*
like for ex. in my case : 
    /sys/devices/platform/host5/session3/target*/*:*/block/*

In the next line we strip all but the last part, so we end up with *, 
and a few lines later basically try to umount /dev/* .

It's due to the somewhat unintuitive behaviour of the * wildcard. When 
it doesn't match, you get the litteral * .

Sammy

Disclaimer: http://transtrend.com/disclaimer.txt 



More information about the Pkg-iscsi-maintainers mailing list