From nobody Sun Feb 8 22:34:53 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582730499; cv=none; d=zohomail.com; s=zohoarc; b=DvjWV+usU37hP5Q3Ve5Pcbz1ija+bOaShifurqdO1ecy3iDi98p3a/jpP118qGzJ4W4NF3RhBmn5xnct3Vtm9IEWVGi2aCO+WpIqFFa7qLVyM081ixs2EARTUn3tVL9DLOI4Nqy/1LPa5mgTgR6z4XiJp/ys0RQePURvk6rcREw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582730499; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AzpbDroNSOfbV2EhTlJ8CfVzm80i7DQ9zq05iAUxmuc=; b=ACwDIyWknsKP2KZ6q4OZNCERbM0eZaxrumkvISEN4J/k5xw1u/fmZ35LuaOJAvWjqXDsZkwMr1c1YfBec8DwjS9czehAmgih2OzlFLnY6cMZ5H3Io8X7yB02jyWOnRXnDb23dkKX0OxSw9YZO01115S+KTyYrhEWLm+8gT2HqNk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582730499734744.708532967336; Wed, 26 Feb 2020 07:21:39 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6yUh-0001CK-Ph; Wed, 26 Feb 2020 15:21:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6yUg-0001C9-MU for xen-devel@lists.xenproject.org; Wed, 26 Feb 2020 15:21:02 +0000 Received: from mail-qt1-x841.google.com (unknown [2607:f8b0:4864:20::841]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 97d1ba78-58ab-11ea-a490-bc764e2007e4; Wed, 26 Feb 2020 15:20:59 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id r5so2480833qtt.9 for ; Wed, 26 Feb 2020 07:20:59 -0800 (PST) Received: from pm2-ws13.praxislan02.com ([2001:470:8:67e:ba27:ebff:fee8:ce27]) by smtp.gmail.com with ESMTPSA id q196sm327187qke.80.2020.02.26.07.20.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 07:20:58 -0800 (PST) X-Inumbo-ID: 97d1ba78-58ab-11ea-a490-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VFOAd65lQswkmbzdAMYJGUSVTalFZ80HbsJPAnnzq2k=; b=Qy+LmqcnrO4tFK9DKfrKCg5Xis7lwdWKVieMep9iDcrcSHJ2Jpvhaz9JsSc+6qxkhv 3JWWZUBFyGe728K9iYsFiFzQ6B5kgvFoB/UVaOaP2jIxVRomPkq1y6sBVk4zyUfHTKcf 8f+j8NeauX6qJ3g2J7J46aYdnVZbE5ROYGAWY+gdHvuKLzAzcuSVF+XgCauVRpGwOk5l x3p2NYqzUzhUgtSp+7OEP/g+/yqpd1BzVrxUAXfnXi2WQQlwm1tSLd8wvtjU7wNfLn6N qAenp6eU1BfcwKbmGFPYKb1z2I1hnaLahBjMCJU+ed+oqQz/PXRKw5loICccv5uaV5VM GaAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VFOAd65lQswkmbzdAMYJGUSVTalFZ80HbsJPAnnzq2k=; b=OimENtyiGpT/VDy5nnjuyVCseCvHGac0LrB2tN/afUP9/jtJ4KUAQ1bgbuSsC3dLgw wcnnWi64DodHKbP2TRPXEe8ubgzdnbIjNHtOFFqG7UCjO2ThQRYayDY4VYSTa4Qm4OqM Vz+oFvtgjSm72dVE+GoZrW1aQ0qpxMX6Rq6m1B10jZRfts0L9M6LEXczXLmO5F7n3rBP bMDMSVk57L7vjvHueNMqBht+9jRG7NbdM0LfkBAAtUv8npXcqksa8wxl/kaxl3YQd3Yi /tljjNZ0ASC8DaICnFvUd69K9rzzyWtiCGTidfxf9nNrYSJP6ayd00yq687du7tTp12k JoiQ== X-Gm-Message-State: APjAAAVODoJ65JMxYRAKA1UlrfXYvFl8Oc2CBKGkCxeGkogA3bj4Ab+y Ko8PbdNaGwxZQdPazZV23KqvQhC6 X-Google-Smtp-Source: APXvYqxKwRrFeHXykdEtDwbAPXl/JpTWF8CC8F9DYXFbHDP37dpEi7+p/90GZQv8TsCu4GHmv/9csw== X-Received: by 2002:ac8:7101:: with SMTP id z1mr5242193qto.333.1582730459173; Wed, 26 Feb 2020 07:20:59 -0800 (PST) From: Jason Andryuk To: xen-devel@lists.xenproject.org Date: Wed, 26 Feb 2020 10:20:13 -0500 Message-Id: <20200226152013.12200-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200226152013.12200-1-jandryuk@gmail.com> References: <20200226152013.12200-1-jandryuk@gmail.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] Linux/locking.sh: Use cmp-fd-file-inode for lock check X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , Wei Liu , Jason Andryuk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Replace perl with cmp-fd-file-inode when checking that the lock file descriptor and lockfile inodes match. Signed-off-by: Jason Andryuk --- tools/hotplug/Linux/locking.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh index c6a7e96ff9..de468c4bb5 100644 --- a/tools/hotplug/Linux/locking.sh +++ b/tools/hotplug/Linux/locking.sh @@ -50,14 +50,8 @@ claim_lock() # actually a synthetic symlink in /proc and we aren't # guaranteed that our stat(2) won't lose the race with an # rm(1) between reading the synthetic link and traversing the - # file system to find the inum. Perl is very fast so use that. - rightfile=3D$( perl -e ' - open STDIN, "<&'$_lockfd'" or die $!; - my $fd_inum =3D (stat STDIN)[1]; die $! unless defined $fd_inu= m; - my $file_inum =3D (stat $ARGV[0])[1]; - print "y\n" if $fd_inum eq $file_inum; - ' "$_lockfile" ) - if [ x$rightfile =3D xy ]; then break; fi + # file system to find the inum. + if cmp-fd-file-inode $_lockfd $_lockfile ; then break; fi # Some versions of bash appear to be buggy if the same # $_lockfile is opened repeatedly. Close the current fd here. eval "exec $_lockfd<&-" --=20 2.24.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel