[GFS2] Fix journal off-by-one error
authorBenjamin Marzinski <bmarzins@redhat.com>
Thu, 24 Aug 2006 19:47:17 +0000 (14:47 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 25 Aug 2006 13:57:41 +0000 (09:57 -0400)
commit5dc39fe621ead2fa2a0439a686be4df185861eae
tree3ca539e18bae3f45f0e807165998440db0f7a033
parenta2242db0906445491d9ac50bfa756b0de0a25d45
[GFS2] Fix journal off-by-one error

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: Benjamin E. Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/log.c