diff options
author | Kouya Shimura <kouya@jp.fujitsu.com> | 2010-12-15 16:49:06 +0000 |
---|---|---|
committer | Kouya Shimura <kouya@jp.fujitsu.com> | 2010-12-15 16:49:06 +0000 |
commit | 5d0efa621fff90f4252108dacb8155f222145c96 (patch) | |
tree | 29f973f1aa5b1a4ea54ba4cf2514fc1a06d590bf /tools/hotplug/Linux | |
parent | 99b2c7638276d88b45839a22a77d94c35a5472a1 (diff) | |
download | xen-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/Linux')
-rw-r--r-- | tools/hotplug/Linux/locking.sh | 2 |
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 |