DAFS: Allow LEAVE_OFF for DELETED volumes
authorAndrew Deason <adeason@sinenomine.net>
Wed, 2 Mar 2011 21:02:40 +0000 (15:02 -0600)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Mar 2011 15:36:08 +0000 (07:36 -0800)
When a volume is VOL_STATE_DELETED, it effectively does not exist to
other programs over FSSYNC. So, do not prevent someone from issuing a
FSYNC_VOL_LEAVE_OFF for a VOL_STATE_DELETED volume.

Change-Id: Ifb8f5437c7f6888bc06968297d841072d1f3316a
Reviewed-on: http://gerrit.openafs.org/4119
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/vol/fssync-server.c

index d7f516a..8e2c088 100644 (file)
@@ -727,7 +727,7 @@ FSYNC_com_VolOn(FSSYNC_VolOp_command * vcom, SYNC_response * res)
     if (vcom->hdr->command == FSYNC_VOL_LEAVE_OFF) {
        /* nothing much to do if we're leaving the volume offline */
 #ifdef AFS_DEMAND_ATTACH_FS
-       if (vp) {
+       if (vp && V_attachState(vp) != VOL_STATE_DELETED) {
            if (FSYNC_partMatch(vcom, vp, 1)) {
                if ((V_attachState(vp) == VOL_STATE_UNATTACHED) ||
                    (V_attachState(vp) == VOL_STATE_PREATTACHED)) {