From: Andrew Deason Date: Thu, 22 Apr 2010 16:54:06 +0000 (-0500) Subject: Update nextVnodeUnique before checking inUse X-Git-Tag: openafs-devel-1_5_74_1~4 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=30f2dded7340a776f2d41a17cee944ef83665648 Update nextVnodeUnique before checking inUse When attaching a volume, update the nextVnodeUnique field for the volume, before we do any checks on the volume; for example, checking inUse, which may result in a demand-salvage if we are running DAFS. If we do not do this, we can schedule a demand-salvage without setting nextVnodeUnique, and VUpdateVolume_r will update the volume header uniquifier to nextVnodeUnique+200, when nextVnodeUnique is not set. So, we will always set the uniquifier to 200. Fortunately, the salvage should usually fix the uniquifer anyway. So, set nextVnodeUnique before doing any of those checks, to avoid screwing up the uniquifier when taking the volume offline. Change-Id: Ib211bbf5e93efbebcb679259944e7abf211aa6e1 Reviewed-on: http://gerrit.openafs.org/1809 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear --- diff --git a/src/vol/volume.c b/src/vol/volume.c index 990327f..41f9cce 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -3206,6 +3206,7 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, } VOL_LOCK; + vp->nextVnodeUnique = V_uniquifier(vp); if (VShouldCheckInUse(mode)) { #ifndef FAST_RESTART if (V_inUse(vp) && VolumeWriteable(vp)) { @@ -3251,7 +3252,6 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, } } - vp->nextVnodeUnique = V_uniquifier(vp); vp->vnodeIndex[vSmall].bitmap = vp->vnodeIndex[vLarge].bitmap = NULL; #ifndef BITMAP_LATER if (programType == fileServer && VolumeWriteable(vp)) {