From patchwork Wed Jul 20 13:19:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9239617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17504602F0 for ; Wed, 20 Jul 2016 13:22:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0838626C9B for ; Wed, 20 Jul 2016 13:22:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F133227BFF; Wed, 20 Jul 2016 13:22:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A19DC26C9B for ; Wed, 20 Jul 2016 13:22:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPrPj-00056H-NI; Wed, 20 Jul 2016 13:19:51 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPrPi-00055G-HX for xen-devel@lists.xenproject.org; Wed, 20 Jul 2016 13:19:50 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 84/41-13744-57A7F875; Wed, 20 Jul 2016 13:19:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsXitHSDvW5pVX+ 4wYHDYhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8at6TvYCqayVuxcXNTAuIqli5GTQ0LAX+Lf +2Ywm01AV6Jpy1+2LkYODhEBFYnbew1ATGaBUIkdLyxBKoSBzPnvf7OB2CwCqhKH7zeAVfMKe Eo0NzhCDJSTOH/8JzOIzSngJXFk5iZ2EFsIqGTuhtfsIOVCAmoSc9fHg4R5BQQlTs58ArafWU BC4uCLF8wgJRIC3BJ/u+0nMPLNQlI1C0nVAkamVYzqxalFZalFuoZ6SUWZ6RkluYmZObqGBmZ 6uanFxYnpqTmJScV6yfm5mxiBYcQABDsYdz53OsQoycGkJMqrKtobLsSXlJ9SmZFYnBFfVJqT WnyIUYaDQ0mCN6uyP1xIsCg1PbUiLTMHGNAwaQkOHiUR3skgad7igsTc4sx0iNQpRl2OBT9ur 2USYsnLz0uVEucNBCkSACnKKM2DGwGLrkuMslLCvIxARwnxFKQW5WaWoMq/YhTnYFQS5lUGmc KTmVcCt+kV0BFMQEfMEQA7oiQRISXVwOjbn3THUlQ7zGafK1fkrqjkNIbQjKuzZk0Pz7W5Yv2 OzSf1+u6ziW4Xl17Tn7xsAnvoW/kzMZYMsbc5K58s2ev6J/h/33OlyneWNvOPJztHH2g8Jj4r Ry1j3b/WOYVm0/7O/CIlX+PhfG16SdSh8KRQwayjJ4/LSwn2/dkw5+92iysin0JS+ZRYijMSD bWYi4oTASHbDQSpAgAA X-Env-Sender: prvs=00244cc2b=Ian.Jackson@citrix.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1469020787!24755265!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50631 invoked from network); 20 Jul 2016 13:19:49 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 20 Jul 2016 13:19:49 -0000 X-IronPort-AV: E=Sophos;i="5.28,394,1464652800"; d="scan'208";a="374274751" From: Ian Jackson To: Date: Wed, 20 Jul 2016 14:19:10 +0100 Message-ID: <1469020751-12413-4-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1469020751-12413-1-git-send-email-ian.jackson@eu.citrix.com> References: <1469020751-12413-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 4/5] cr-ensure-disk-space: Run check_space before taking lock X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This allows cr-ensure-disk-space to be a noop if there is enough space, even if run on a host which doesn't have access to the relevant lock directory. Signed-off-by: Ian Jackson --- cr-ensure-disk-space | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 63e92f4..2d299dd 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -61,6 +61,8 @@ sub check_space () { return $space >= logcfg('MinSpaceMby'); } +exit 0 if check_space; + my $lock = "$c{GlobalLockDir}/publish-lock"; open LOCK, "> $lock" or die "$lock $!"; flock LOCK, LOCK_EX or die $!;