]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cr-ensure-disk-space: Run check_space before taking lock
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 19 Jul 2016 16:25:48 +0000 (17:25 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 19 Jul 2016 16:25:48 +0000 (17:25 +0100)
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 <Ian.Jackson@eu.citrix.com>
cr-ensure-disk-space

index 63e92f40a244254477ba4d47fa5b02965db3cd0b..2d299ddc31dafd9e383bd743b002b662085fff0b 100755 (executable)
@@ -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 $!;