• B
    [GFS2] Fix journal off-by-one error · 5dc39fe6
    Benjamin Marzinski 提交于
    log_refund() incorrectly assumed that if a transaction had been touched, it
    always committed buffers to the incore log. Thus, when you got around to
    flushing the log, you would need one more block than you committed, to account
    for the header. So it automatically set reserved to 1, which had the effect of
    making sdp->sd_log_blks_reserved one greater when you got to gfs2_log_flush().
    However, if you don't actually commit anything to the incore log between
    flushes, you don't need the header, because you aren't writing anything out.
    With this patch, log_refund() only increments reservered to account for the
    header if something has been committed since the last flush.
    Signed-off-by: NBenjamin E. Marzinski <bmarzins@redhat.com>
    Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
    5dc39fe6
log.c 14.7 KB