<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#CCCCCC">
    <div class="moz-cite-prefix">On 04/25/2014 11:48 AM, Sammy Atmadja
      wrote:<br>
    </div>
    <blockquote
      cite="mid:988938312.2055531.1398406738819.JavaMail.root@transtrend.com"
      type="cite">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">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 ?
</pre>
      </blockquote>
      <pre wrap="">
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: <a class="moz-txt-link-freetext" href="http://transtrend.com/disclaimer.txt">http://transtrend.com/disclaimer.txt</a> 
</pre>
    </blockquote>
    <br>
    Thanks. Makes sense. I will prepare an upload soon.<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ritesh Raj Sarraf | <a class="moz-txt-link-freetext" href="http://people.debian.org/~rrs">http://people.debian.org/~rrs</a>
Debian - The Universal Operating System
</pre>
  </body>
</html>