提交 81158e0c 编写于 作者: D Dave Chinner 提交者: Ben Myers

xfs: prevent needless mount warning causing test failures

Often mounting small filesystem with small logs will emit a warning
such as:

XFS (vdb): Invalid block length (0x2000) for buffer

during log recovery. This causes tests to randomly fail because this
output causes the clean filesystem checks on test completion to
think the filesystem is inconsistent.

The cause of the error is simply that log recovery is asking for a
buffer size that is larger than the log when zeroing the tail. This
is because the buffer size is rounded up, and if the right head and
tail conditions exist then the buffer size can be larger than the log.
Limit the variable size xlog_get_bp() callers to requesting buffers
smaller than the log.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NBen Myers <bpm@sgi.com>
上级 d3bc815a
...@@ -440,6 +440,8 @@ xlog_find_verify_cycle( ...@@ -440,6 +440,8 @@ xlog_find_verify_cycle(
* a log sector, or we're out of luck. * a log sector, or we're out of luck.
*/ */
bufblks = 1 << ffs(nbblks); bufblks = 1 << ffs(nbblks);
while (bufblks > log->l_logBBsize)
bufblks >>= 1;
while (!(bp = xlog_get_bp(log, bufblks))) { while (!(bp = xlog_get_bp(log, bufblks))) {
bufblks >>= 1; bufblks >>= 1;
if (bufblks < log->l_sectBBsize) if (bufblks < log->l_sectBBsize)
...@@ -1225,6 +1227,8 @@ xlog_write_log_records( ...@@ -1225,6 +1227,8 @@ xlog_write_log_records(
* log sector, or we're out of luck. * log sector, or we're out of luck.
*/ */
bufblks = 1 << ffs(blocks); bufblks = 1 << ffs(blocks);
while (bufblks > log->l_logBBsize)
bufblks >>= 1;
while (!(bp = xlog_get_bp(log, bufblks))) { while (!(bp = xlog_get_bp(log, bufblks))) {
bufblks >>= 1; bufblks >>= 1;
if (bufblks < sectbb) if (bufblks < sectbb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册