xfs: fix min bufsize bugs in two places
authorAlex Elder <aelder@sgi.com>
Tue, 13 Apr 2010 05:22:29 +0000 (15:22 +1000)
committerAlex Elder <aelder@sgi.com>
Wed, 19 May 2010 14:58:12 +0000 (09:58 -0500)
commit6881a229f66f74e4e0a73504389695213987955b
tree8faf52f576ab7bfc49712cfd98c49d23a596a98b
parenta0e856b0b4d182c4c52b568bd04bd96a172247a7
xfs: fix min bufsize bugs in two places

This fixes a bug in two places that I found by inspection.  In
xlog_find_verify_cycle() and xlog_write_log_records(), the code
attempts to allocate a buffer to hold as many blocks as possible.
It gives up if the number of blocks to be allocated gets too small.
Right now it uses log->l_sectbb_log as that lower bound, but I'm
sure it's supposed to be the actual log sector size instead.  That
is, the lower bound should be (1 << log->l_sectbb_log).

Also define a simple macro xlog_sectbb(log) to represent the number
of basic blocks in a sector for the given log.

(No change from original submission; I have implemented Christoph's
suggestion about storing l_sectsize rather than l_sectbb_log in
a new, separate patch in this series.)

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/xfs_log_recover.c