From dba991728ba5a90af316928348053189dac80398 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 23 Mar 2011 16:46:47 -0500 Subject: [PATCH] DAFS: Do not record vol ops for DELETED vols When a volume is VOL_STATE_DELETED, it effectively does not exist, so there is little point in recording a vp->pending_vol_op structure for it. Just let callers checkout the volume as they would a nonexistent volume: without recording anything about the operation. This just reduces some edge cases and confusing debugging info, so we don't have to worry about cleaning up pending_vol_op structures for nonexistent volumes. Change-Id: I56b92c3f2548ea48f9c61100be07edf9f7277fee Reviewed-on: http://gerrit.openafs.org/4296 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/fssync-server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index d163442..a5786b7 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -980,7 +980,6 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res) case VOL_STATE_PREATTACHED: case VOL_STATE_SALVAGING: case VOL_STATE_ERROR: - case VOL_STATE_DELETED: /* register the volume operation metadata with the volume * * if the volume is currently pre-attached, attach2() @@ -988,6 +987,9 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res) * attaching the volume would be safe */ VRegisterVolOp_r(vp, &info); vp->pending_vol_op->vol_op_state = FSSYNC_VolOpRunningUnknown; + /* fall through */ + + case VOL_STATE_DELETED: goto done; default: break; @@ -1008,7 +1010,6 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res) case VOL_STATE_PREATTACHED: case VOL_STATE_SALVAGING: case VOL_STATE_ERROR: - case VOL_STATE_DELETED: /* register the volume operation metadata with the volume * * if the volume is currently pre-attached, attach2() @@ -1016,6 +1017,9 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res) * attaching the volume would be safe */ VRegisterVolOp_r(vp, &info); vp->pending_vol_op->vol_op_state = FSSYNC_VolOpRunningUnknown; + /* fall through */ + + case VOL_STATE_DELETED: goto done; default: break; -- 1.9.4