[Bug 605721] Re: tgtd target will not start unless it's configured with "allow-in-use yes"

Chris Cheney ccheney at ubuntu.com
Tue Jul 20 10:07:15 BST 2010


Hmm looking at the code I think its buggy. I'm not sure what it is
actually trying to do but it doesn't seem to be doing it right in any
case. It appears to be 8 bit shifting left, and then checking for 0. If
the device is in use lsof returns 0 if it is not then it returns 1, at
least as best as I can tell, in which case doing the bit shift causes
the problem. I am not sure why it was added, but it probably was needed
for something.

        # Check if userspace uses this device
        my $lsof_check = check_exe("lsof");
        if ($lsof_check ne 1) {
                system("lsof $backing_store &>/dev/null");
                my $exit_value  = $? >> 8;
                if ($exit_value eq 0) {
                        execute("# Device $backing_store is used (already tgtd target?).");
                        execute("# Run 'lsof $backing_store' to see the details.");
                        return 0;
                }
        }
        return 1;
}

-- 
tgtd target will not start unless it's configured with "allow-in-use yes"
https://bugs.launchpad.net/bugs/605721
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to tgt in ubuntu.



More information about the Ubuntu-server-bugs mailing list