aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug
diff options
context:
space:
mode:
authorKouya Shimura <kouya@jp.fujitsu.com>2010-12-15 16:49:06 +0000
committerKouya Shimura <kouya@jp.fujitsu.com>2010-12-15 16:49:06 +0000
commit5d0efa621fff90f4252108dacb8155f222145c96 (patch)
tree29f973f1aa5b1a4ea54ba4cf2514fc1a06d590bf /tools/hotplug
parent99b2c7638276d88b45839a22a77d94c35a5472a1 (diff)
downloadxen-5d0efa621fff90f4252108dacb8155f222145c96.tar.gz
xen-5d0efa621fff90f4252108dacb8155f222145c96.tar.bz2
xen-5d0efa621fff90f4252108dacb8155f222145c96.zip
tools/hotplug/Linux: force release lock if holder process is gone (fix)
22508:57907b28e51a was unsafe for mutual exclusion. There is a case that the owner file doesn't exist yet when an atomic mkdir operation fails. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/hotplug')
-rw-r--r--tools/hotplug/Linux/locking.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index 8748d95454..e233c4763a 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -63,7 +63,7 @@ _claim_lock()
retries=0
else
local pid=$(echo $owner | cut -d : -f 1)
- if [ ! -f "/proc/$pid/status" ]
+ if [ -n "$pid" -a "$pid" != "unknown" -a ! -f "/proc/$pid/status" ]
then
_release_lock $lockdir
fi