df7667d shared: Ensure COPY_HOLES copies trailing holes

Authored and Committed by daandemeyer 2 years ago
    shared: Ensure COPY_HOLES copies trailing holes
    
    Previously, files with a hole at the end would get silently truncated
    which breaks reading journal files. This commit makes sure that holes
    are punched in existing space and if no more space is available, that
    we grow the file and the hole by using ftruncate().
    
    The corresponding test is extended to put a hole at the end of the file
    and we make sure that hole is copied correctly.
    
        
file modified
+44 -2
file modified
+16 -6