From 97474963e58253f8c891e9f6596403213d53527b Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 11 Nov 2010 14:45:04 -0600 Subject: [PATCH] vos release: Avoid full dump on all sites Commit 9fed169b1c5c823fd96cea94daf712b2cf06c901 attempts to remove any remote RO site that has RO_DONTUSE set. However, we set RO_DONTUSE on all sites earlier in the release process if this is a full release, resulting in all sites getting a full dump. Correct this by remembering in 'origflags' what flags each site has before we messed with the vldb entry. Thanks to Mike Meffie. Change-Id: I8c9582c9f7aaee92637ddc1ad11aed96fd69686b Reviewed-on: http://gerrit.openafs.org/3296 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Michael Meffie Tested-by: Michael Meffie --- src/volser/vsprocs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 12b64b097a..7376ae001f 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -174,7 +174,8 @@ static int DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part, afs_int32 flags); static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr, afs_int32 * transPtr, - afs_uint32 * crtimePtr, afs_uint32 * uptimePtr); + afs_uint32 * crtimePtr, afs_uint32 * uptimePtr, + afs_int32 *origflags); static int SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid, afs_int32 fromdate, manyDests * tr, afs_int32 flags, @@ -3222,7 +3223,8 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part, static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr, afs_int32 * transPtr, - afs_uint32 * crtimePtr, afs_uint32 * uptimePtr) + afs_uint32 * crtimePtr, afs_uint32 * uptimePtr, + afs_int32 *origflags) { afs_uint32 volid; struct volser_status tstatus; @@ -3247,7 +3249,7 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index, vldbEntryPtr->serverPartition[index], ITOffline, transPtr); - if (!code && (vldbEntryPtr->serverFlags[index] & RO_DONTUSE)) { + if (!code && (origflags[index] & RO_DONTUSE)) { /* If RO_DONTUSE is set, this is supposed to be an entirely new * site. Don't trust any data on it, since it is possible we * have encountered some temporary volume from some other @@ -3436,9 +3438,11 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, int releasecount = 0; struct volser_status volstatus; char hoststr[16]; + afs_int32 origflags[NMAXNSERVERS]; memset(remembertime, 0, sizeof(remembertime)); memset(&results, 0, sizeof(results)); + memset(origflags, 0, sizeof(origflags)); vcode = ubik_VL_SetLock(cstruct, 0, afromvol, RWVOL, VLOP_RELEASE); if (vcode != VL_RERELEASE) @@ -3497,6 +3501,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, m++; if (entry.serverFlags[i] & NEW_REPSITE) s++; } + origflags[i] = entry.serverFlags[i]; } if ((forceflag && !fullrelease) || (s == m) || (s == 0)) fullrelease = 1; @@ -3784,7 +3789,8 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, GetTrans(&entry, vldbindex, &(toconns[volcount]), &(replicas[volcount].trans), &(times[volcount].crtime), - &(times[volcount].uptime)); + &(times[volcount].uptime), + origflags); if (code) continue;