OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_0-60-g45a69b6

Gerrit Code Review gerrit@openafs.org
Fri, 13 Nov 2020 12:36:19 -0500


The following commit has been merged in the master branch:
commit 45a69b61133ae8ca8e49a002ddc1895386796d51
Author: Marcio Barbosa <mbarbosa@sinenomine.net>
Date:   Thu Sep 3 23:57:34 2020 +0000

    volser: take RO volume offline during convertROtoRW
    
    The vos convertROtoRW command converts a RO volume into a RW volume.
    Unfortunately, the RO volume is not checked out from the fileserver
    during this process. As a result, accesses to the volume being converted
    can leave volume objects in an inconsistent state.
    
    Moreover, 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
    
    Notice that this happens because we cannot mark an attached volume as
    destroyed (FSYNC_com_VolDone).
    
    To avoid the problem mentioned above and to prevent accesses to the
    volume being converted, take the RO volume offline before converting it
    to RW.
    
    Change-Id: Ifd342e1f420dc42e5da49242a7aa70db7d97a884
    Reviewed-on: https://gerrit.openafs.org/14340
    Reviewed-by: Andrew Deason <adeason@sinenomine.net>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>

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

-- 
OpenAFS Master Repository