OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_5-41-g49a1ef5

Gerrit Code Review gerrit@openafs.org
Fri, 30 Aug 2013 08:09:50 -0700 (PDT)


The following commit has been merged in the openafs-stable-1_6_x branch:
commit 49a1ef5edfcbfcb411889081d89bc5c112e9033c
Author: Mark Vitale <mvitale@sinenomine.net>
Date:   Tue Mar 12 22:13:20 2013 -0400

    dafs: prevent corruption in large fsstate.dat files
    
    If while writing to the fsstate.dat file, it exceeds the current
    size of the file (multiples of FS_STATE_INIT_FILESIZE (8MiB)),
    we call fs_stateResizeFile.  This un-mmaps, truncates, and
    re-mmaps the file.  Unfortunately, fs_stateMapFile() resets the
    state->mmap.offset and .cursor, so any writes in flight over
    the resize will overwrite the first bytes of the file (and leave
    zeros in the file where the data should have been written).
    
    Upon return from the write that caused a file resize, the offset
    is eventually corrected and the state dump continues with a
    silent failure.  Eventually the state dump completes and the
    file header is rewritten; this may conceal some or all of
    the overwrite damage at offset 0.  However, any zeros near the 8MiB
    offset (and its multiples) remain as corruption.
    
    Add a flag to fs_stateMapFile() to allow the caller to specify if
    the offset and cursor should be preserved.  Modify fs_stateResizeFile()
    to use this capability.
    
    testing note: temporarily reduced FS_STATE_INIT_FILESIZE to 256 bytes
    during testing in order to make the problem easier to reproduce.
    This problem would normally occur only on relatively large/active
    DAFS fileservers.
    
    Reviewed-on: http://gerrit.openafs.org/9599
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
    (cherry picked from commit 42351db75e04e46012208d38f80dc17be7ab776d)
    
    Change-Id: I05a01ebce15e26534361863ed0f8d3161c3f8240
    Reviewed-on: http://gerrit.openafs.org/9683
    Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
    Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Andrew Deason <adeason@sinenomine.net>
    Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

 src/tviced/serialize_state.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

-- 
OpenAFS Master Repository