OpenAFS Master Repository branch, master, updated. BP-openafs-stable-1_8_x-548-g32d35db

Gerrit Code Review gerrit@openafs.org
Fri, 20 Mar 2020 00:17:03 -0400


The following commit has been merged in the master branch:
commit 32d35db64061e4102281c235cf693341f9de9271
Author: Marcio Barbosa <mbarbosa@sinenomine.net>
Date:   Thu Feb 13 00:39:00 2020 -0300

    vos: take RO volume offline during convertROtoRW
    
    The vos convertROtoRW command converts a RO volume into a RW volume.
    Unfortunately, the RO volume in question is not set as "out of service"
    during this process. As a result, accesses to the volume being converted
    can leave volume objects in an inconsistent state.
    
    Consider the following scenario:
    
    1. Create a volume on host_b and add replicas on host_a and host_b.
    
    $ vos create host_b a vol_1
    $ vos addsite host_b a vol_1
    $ vos addiste host_a a vol_1
    
    2. Mount the volume:
    
    $ fs mkmount /afs/.mycell/vol_1 vol_1
    $ vos release vol_1
    $ vos release root.cell
    
    3. Shutdown dafs on host_b:
    
    $ bos shutdown host_b dafs
    
    4. Remove RO reference to host_b from the vldb:
    
    $ vos remsite host_b a vol_1
    
    5. Attach the RO copy by touching it:
    
    $ fs flushall
    $ ls /afs/mycell/vol_1
    
    6. Convert RO copy to RW:
    
    $ vos convertROtoRW host_a a vol_1
    
    Notice that FSYNC_com_VolDone fails silently (FSYNC_BAD_STATE), leaving
    the volume object for the RO copy set as VOL_STATE_ATTACHED (on success,
    this volume should be set as VOL_STATE_DELETED).
    
    7. Add replica on host_a:
    
    $ vos addsite host_a a vol_1
    
    8. Wait until the "inUse" flag of the RO entry is cleared (or force this
    to happen by attaching multiple volumes).
    
    9. Release the volume:
    
    $ vos release vol_1
    
    Failed to start transaction on volume 536870922
    Volume not attached, does not exist, or not on line
    Error in vos release command.
    Volume not attached, does not exist, or not on line
    
    To fix this problem, take the RO volume offline during the vos
    convertROtoRW operation.
    
    Change-Id: I1e417a026ed819fab4435e8992311fcd4f339341
    Reviewed-on: https://gerrit.openafs.org/14066
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

 src/volser/vsprocs.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

-- 
OpenAFS Master Repository