Skip to contentSkip to conversation

Unlock the 'block' lock before bailing out when no loop device can be found

PATCH New Stefan Berger 1 participant 1 message Oct 3, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Unlock the 'block' lock before bailing out when no loop device can be found

Unlock the 'block' lock before bailing out when no available loop device can be found. If this is not done the lock is not given up and results in xend's response time becoming very slow.

I'd recommend applying the patch to the 3.1 testing tree as well.

        if [ "$loopdev" = '' ]
        then

--> missing release lock here!
fatal 'Failed to find an unused loop device'
--> never gets here since fatal leaves with 'exit 1'
fi

do_or_die losetup "$loopdev" "$file" xenstore_write "$XENBUS_PATH/node" "$loopdev" write_dev "$loopdev"
release_lock "block"
exit 0

xen-unstable.hg/tools/examples/block +1 -0
Index: root/xen-unstable.hg/tools/examples/block
===================================================================
@@ -322,6 +322,7 @@ mount it read-write in a guest domain."
 
         if [ "$loopdev" = '' ]
         then
+          release_lock "block"
           fatal 'Failed to find an unused loop device'
         fi
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel