From 1e13ae53b3f1e753211f3ed39ae9d2ea9597cf48 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 2 May 2012 12:11:01 -0500 Subject: [PATCH] vol: Remove redundant vop check in GetVolume VAttachVolumeByVp_r (specifically attach_check_vop in attach2) already handles checking for conflicting vol ops, and gives us VOFFLINE appropriately. We don't need to check again in GetVolume. Change-Id: Ibb93d423d3c856dd957a2569412a85698180ff8e Reviewed-on: http://gerrit.openafs.org/7304 Tested-by: BuildBot Reviewed-by: Tom Keiser Reviewed-by: Derrick Brashear --- src/vol/volume.c | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index 9ca566cc0c..eeaa82415d 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -4105,9 +4105,7 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint, case VSALVAGING: break; case VOFFLINE: - if (!vp->pending_vol_op) { - endloop = 1; - } + endloop = 1; if (vp->specialStatus) { *ec = vp->specialStatus; } @@ -4155,39 +4153,12 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint, } /* - * this test MUST happen after VAttachVolymeByVp, so vol_op_state is - * not VolOpRunningUnknown (attach2 would have converted it to Online - * or Offline) + * this test MUST happen after VAttachVolymeByVp, so we have no + * conflicting vol op. (attach2 would have errored out if we had one; + * specifically attach_check_vop must have detected a conflicting vop) */ + osi_Assert(!vp->pending_vol_op || vp->pending_vol_op->vol_op_state == FSSYNC_VolOpRunningOnline); - /* only valid before/during demand attachment */ - osi_Assert(!vp->pending_vol_op || vp->pending_vol_op->vol_op_state != FSSYNC_VolOpRunningUnknown); - - /* deny getvolume due to running mutually exclusive vol op */ - if (vp->pending_vol_op && vp->pending_vol_op->vol_op_state==FSSYNC_VolOpRunningOffline) { - /* - * volume cannot remain online during this volume operation. - * notify client. - */ - if (vp->specialStatus) { - /* - * special status codes outrank normal VOFFLINE code - */ - *ec = vp->specialStatus; - if (client_ec) { - *client_ec = vp->specialStatus; - } - } else { - if (client_ec) { - *client_ec = VOFFLINE; - } - *ec = VOFFLINE; - } - VChangeState_r(vp, VOL_STATE_UNATTACHED); - FreeVolumeHeader(vp); - vp = NULL; - break; - } #endif /* AFS_DEMAND_ATTACH_FS */ LoadVolumeHeader(ec, vp);