]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: remove incorrect l_sectBBsize assignment in xfs_repair
authorEric Sandeen <sandeen@redhat.com>
Mon, 7 Oct 2013 17:35:16 +0000 (17:35 +0000)
committerRich Johnston <rjohnston@sgi.com>
Thu, 17 Oct 2013 19:52:56 +0000 (14:52 -0500)
commit5425725c56bccb9a91847cb74cfdadc8b44fecf7
tree11a404796ee81f8ab39f15822e0b9b183849562e
parente64190f8440286a815060524777b435e06a7b364
xfsprogs: remove incorrect l_sectBBsize assignment in xfs_repair

Commit e0607266 xfsprogs: add crc format support to repair

added a 2nd assignment to l_sectBBsize:

log.l_sectBBsize = 1 << mp->m_sb.sb_logsectlog;

which is incorrect; sb_logsectlog is log2 of the sector size,
in bytes; l_sectBBsize is the size of the log sector in
512-byte units.

So for a 4k sector size log, we were assigning 4096 rather
than 8.  This broke xlog_find_tail, and caused xfs_repair
to think that a log was dirty even when it was clean:

"ERROR: The filesystem has valuable metadata changes in a log"

(xfs_logprint didn't have this error, so xfs_logprint -t
agreed that the filesystem really was clean).

Just remove the incorrect assignment; it was already properly
assigned about 12 lines prior:

        log.l_sectBBsize  = BTOBB(x.lbsize);

and things work again.

(This worked accidentally for 512-sector devices, because
we special-case those and set sb_logsectlog to "0" rather
than 9, so l_sectBBsize came out to "1" (as in 1 sector),
as it should have).

Reporteed-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
repair/phase2.c