Skip to content
  • Benjamin Marzinski's avatar
    [GFS2] fix jdata issues · ddf4b426
    Benjamin Marzinski authored
    
    
    This is a patch for the first three issues of RHBZ #238162
    
    The first issue is that when you allocate a new page for a file, it will not
    start off uptodate. This makes sense, since you haven't written anything to that
    part of the file yet.  Unfortunately, gfs2_pin() checks to make sure that the
    buffers are uptodate.  The solution to this is to mark the buffers uptodate in
    gfs2_commit_write(), after they have been zeroed out and have the data written
    into them.  I'm pretty confident with this fix, although it's not completely
    obvious that there is no problem with marking the buffers uptodate here.
    
    The second issue is simply that you can try to pin a data buffer that is already
    on the incore log, and thus, already pinned. This patch checks to see if this
    buffer is already on the log, and exits databuf_lo_add() if it is, just like
    buf_lo_add() does.
    
    The third issue is that gfs2_log_flush() doesn't do it's block accounting
    correctly.  Both metadata and journaled data are logged, but gfs2_log_flush()
    only compares the number of metadata blocks with the number of blocks to commit
    to the ondisk journal.  This patch also counts the journaled data blocks.
    
    Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
    Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    ddf4b426