[2069] in Moira
afs_utils.pl patch
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Jun 10 17:31:36 2004
Message-Id: <200406102131.i5ALVXxn028344@sipb-office-escape-pod.mit.edu>
To: moiradev@MIT.EDU
cc: cfox@MIT.EDU
Date: Thu, 10 Jun 2004 17:31:33 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Below is a patch to afs_utils.pl's afs_find() subroutine that removes
the magic hardcoded constant for the maximum amount of overallocation we
consider acceptable for a vice partition. With this patch applied,
afs_find() will always return the least overallocated partition, rather
than sometimes declaring there's no space available.
In practice, the only time the "no space available" case gets triggered
these days is when we do a quota increase or shuffle lots of mostly
empty volumes onto a partition, and I don't think we ever expect to be
space constrained enough again that we want moira to fail homedir
creations due to perceived overallocation.
Garry
Index: afs_utils.pl
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/incremental/afs/afs_utils.pl,v
retrieving revision 1.4
diff -u -r1.4 afs_utils.pl
--- afs_utils.pl 8 Jun 2004 21:25:10 -0000 1.4
+++ afs_utils.pl 10 Jun 2004 21:28:39 -0000
@@ -82,7 +82,7 @@
{
local($cell,$type,$quota,@except) = @_;
local($j,$k);
- local(@max) = ("", "", -10000000000);
+ local(@max) = ("", "", undef);
&afs_lock;
chop(@afs_data);
@@ -96,7 +96,7 @@
}
$alloc = $used if ($alloc < $used);
$j = 2*$total - $used - $alloc;
- @max = ($asrv,$apart,$j) if (! @max || $j > $max[2]);
+ @max = ($asrv,$apart,$j) if (!$max[2] || $j > $max[2]);
}
&afs_unlock;