07afbc6 libgfs2: Make rebuild functions not re-read ip

Authored and Committed by rpeterso 12 years ago
    libgfs2: Make rebuild functions not re-read ip
    
    Before this patch, the libgfs2 rebuild functions in structures.c
    were not consistent about reading in the gfs2_inode in-core struct.
    Some of the functions did and some didn't.  The previous patch to
    make fsck.gfs2 operate on gfs1 introduced a problem because the code
    was changed to re-read the inum and statfs files if they were rebuilt.
    But since the functions already did the read, it was a double-read.
    A double-read is a bad thing because inode writes are now done on
    the last inode put, and the double-read messed up the counter.
    (Number of inode gets should match puts).  This patch makes all the
    build functions consistent: they all put the inode after building,
    except for root and master which have no parent inodes.
    
    There was also a minor problem whereby leaf searches were getting
    the number of entries from the directory buffer rather than from
    the dinode itself.  (The buffer may be out of date, but the dinode
    should always be current).  So there were circumstances where you
    could add a new dirent to "master" but the count of entries was not
    correct in the buffer, which caused the search to stop prematurely.
    
    rhbz#675723
    
        
file modified
+3 -0
file modified
+5 -0
file modified
+5 -5
file modified
+2 -2
file modified
+2 -0