xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: [PATCH] hotplug/Linux: close lockfd after lock attempt
Date: Sat, 13 Oct 2012 17:59:28 +0200	[thread overview]
Message-ID: <5aa14d5afe6b1f35b230.1350143968@probook.site> (raw)

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350143934 -7200
# Node ID 5aa14d5afe6b1f35b23029ae90b7edb20367bbeb
# Parent  e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d
hotplug/Linux: close lockfd after lock attempt

When a HVM guest is shutdown some of the 'remove' events can not claim
the lock for some reason. Instead they try to grab the lock in a busy
loop, until udev reaps the xen-hotplug-cleanup helper.
After analyzing the resulting logfile its not obvious what the cause is.
The only explanation is that bash (?) gets confused if the same lockfd
is opened again and again. Closing it in each iteration seem to fix the
issue.

This was observed with sles11sp2 and 4.2 xend.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r e0e1350dfe9b -r 5aa14d5afe6b tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -59,6 +59,7 @@ claim_lock()
             print "y\n" if $fd_inum eq $file_inum;
                              ' "$_lockfile" )
         if [ x$rightfile = xy ]; then break; fi
+        eval "exec $_lockfd<&-"
     done
 }

             reply	other threads:[~2012-10-13 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 15:59 Olaf Hering [this message]
2012-10-13 22:35 ` [PATCH] hotplug/Linux: close lockfd after lock attempt Olaf Hering
2012-10-15  8:01   ` Ian Campbell
2012-10-15  8:42     ` Olaf Hering
2012-10-18  8:35       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5aa14d5afe6b1f35b230.1350143968@probook.site \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).