From: Tom Keiser Date: Mon, 14 Jul 2008 14:42:30 +0000 (+0000) Subject: DEVEL15-dafs-avoid-assert-while-moving-volumes-20080714 X-Git-Tag: openafs-devel-1_5_50~9 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=796a42bae538e46750f9ca2edd4cd9786f6e04e2;p=packages%2Fo%2Fopenafs.git DEVEL15-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(). (cherry picked from commit 5c762d3b7672a88fcf4df85e919ac11be7946d4f) --- 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)