[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools/hotplug/Linux: force release lock if holder process is gone (fix)



# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1292431746 0
# Node ID c3c1fd0a940c434aa6b69463b090f365c42d463b
# Parent  764e95f64b28b381abcc40ddad5e77d47572f4d6
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@xxxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/hotplug/Linux/locking.sh |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 764e95f64b28 -r c3c1fd0a940c tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh    Wed Dec 15 14:16:03 2010 +0000
+++ b/tools/hotplug/Linux/locking.sh    Wed Dec 15 16:49:06 2010 +0000
@@ -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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.