From f94429ef3d76f9848332c1339f3e6159210ad233 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 22 Jan 2009 19:12:51 +0000 Subject: [PATCH] DEVEL15-volserver-manage-inuse-better-20090122 LICENSE IPL10 FIXES 124142 V_PEEK/V_SECRETLY should not change inUse. servertype based inUse should not leak past giving back a volume. (cherry picked from commit 92cf4d996f91e895b8995d41419b32843a40b9fb) --- src/vol/volume.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index cb0f08894..08a41bda7 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -2509,7 +2509,8 @@ attach2(Error * ec, VolId volumeId, char *path, register struct VolumeHeader * h V_offlineMessage(vp)[0] = '\0'; } } else { - V_inUse(vp) = programType; + if ((mode != V_PEEK) && (mode != V_SECRETLY)) + V_inUse(vp) = programType; V_checkoutMode(vp) = mode; } @@ -3199,6 +3200,9 @@ VDetachVolume_r(Error * ec, Volume * vp) DeleteVolumeFromVByPList_r(vp); VLRU_Delete_r(vp); VChangeState_r(vp, VOL_STATE_SHUTTING_DOWN); +#else + if (programType != fileServer) + V_inUse(vp) = 0; #endif /* AFS_DEMAND_ATTACH_FS */ VPutVolume_r(vp); /* Will be detached sometime in the future--this is OK since volume is offline */ -- 2.39.5