From: Derrick Brashear Date: Wed, 21 Aug 2002 06:53:23 +0000 (+0000) Subject: STABLE12-realcellindex-fix-allocation-20020821 X-Git-Tag: openafs-stable-1_2_7~53 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d6dc35cd9ec6d3c391ddb731d2f84e6e331be7d2;p=packages%2Fo%2Fopenafs.git STABLE12-realcellindex-fix-allocation-20020821 fix comparison and the double allocation it uncovers (cherry picked from commit ae3e679ab0163560a29ca51eec77a2c897a8f216) --- diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 79a06809a..be0cadfce 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -509,7 +509,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport tc->vlport = (vlport ? vlport : AFS_VLPORT); afs_stats_cmperf.numCellsVisible++; newc++; - if (!aflags & CAlias) { + if (!(aflags & CAlias)) { tc->realcellIndex = afs_realcellindex++; } else { tc->realcellIndex = -1; @@ -543,7 +543,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport tc->timeout = timeout; /* Allow converting an alias into a real cell */ - if (!(aflags & CAlias)) { + if ((!(aflags & CAlias)) && (tc->states & CAlias)) { tc->states &= ~CAlias; tc->realcellIndex = afs_realcellindex++; }