From: Tom Keiser Date: Mon, 14 Jul 2008 14:37:58 +0000 (+0000) Subject: dafs-avoid-assert-while-moving-volumes-20080714 X-Git-Tag: openafs-devel-1_5_61~967 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5c762d3b7672a88fcf4df85e919ac11be7946d4f;p=packages%2Fo%2Fopenafs.git dafs-avoid-assert-while-moving-volumes-20080714 LICENSE IPL10 The volume state is perfectly consistent. FSYNC_NEEDVOLUME (and the other state in the pending_vol_op object) is perfectly normal -- it simply means the volser has exclusive access to the volume for the purposes of cloning. The bug is that during the DAFS development, I changed the semantics of the VGetVolume interface without updating the control logic in afsfileprocs accordingly: In 1_4_x: vp->specialstatus != 0 results in returning vp with nUsers incremented and *ec = vp->sepcialstatus In DAFS: V_AttachState(vp) == VOL_STATE_UNATTACHED results in returning a NULL vp. Since (vp->specialstatus != 0), *ec = vp->specialstatus. The net result is we need to modify the VBUSY logic in CheckVnode(). --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 09385c5ac..2af9cd17e 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -559,6 +559,14 @@ CheckVnode(AFSFid * fid, Volume ** volptr, Vnode ** vptr, int lock) * must check local_errorCode because demand attach fs * can have local_errorCode == VSALVAGING, errorCode == VBUSY */ else if (local_errorCode == VBUSY && lock == READ_LOCK) { +#ifdef AFS_DEMAND_ATTACH_FS + /* DAFS case is complicated by the fact that local_errorCode can + * be VBUSY in cases where the volume is truly offline */ + if (!*volptr) { + /* volume is in VOL_STATE_UNATTACHED */ + return (errorCode); + } +#endif /* AFS_DEMAND_ATTACH_FS */ errorCode = 0; break; } else if (errorCode)