Blame SOURCES/xfsprogs-3.2.0-fix-l_sectBBsize.patch

564d46
[PATCH] xfsprogs: remove incorrect l_sectBBsize assignment in xfs_repair
564d46
564d46
Commit e0607266 xfsprogs: add crc format support to repair
564d46
564d46
added a 2nd assignment to l_sectBBsize:
564d46
564d46
	log.l_sectBBsize = 1 << mp->m_sb.sb_logsectlog;
564d46
564d46
which is incorrect; sb_logsectlog is log2 of the sector size,
564d46
in bytes; l_sectBBsize is the size of the log sector in
564d46
512-byte units.
564d46
564d46
So for a 4k sector size log, we were assigning 4096 rather
564d46
than 8.  This broke xlog_find_tail, and caused xfs_repair
564d46
to think that a log was dirty even when it was clean:
564d46
564d46
"ERROR: The filesystem has valuable metadata changes in a log"
564d46
564d46
(xfs_logprint didn't have this error, so xfs_logprint -t
564d46
agreed that the filesystem really was clean).
564d46
564d46
Just remove the incorrect assignment; it was already properly
564d46
assigned about 12 lines prior:
564d46
564d46
        log.l_sectBBsize  = BTOBB(x.lbsize);
564d46
564d46
and things work again.
564d46
564d46
(This worked accidentally for 512-sector devices, because
564d46
we special-case those and set sb_logsectlog to "0" rather
564d46
than 9, so l_sectBBsize came out to "1" (as in 1 sector),
564d46
as it should have).
564d46
564d46
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
564d46
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
564d46
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
564d46
Reviewed-by: Dave Chinner <dchinner@redhat.com>
564d46
---
564d46
564d46
diff --git a/repair/phase2.c b/repair/phase2.c
564d46
index a62854e..2817fed 100644
564d46
--- a/repair/phase2.c
564d46
+++ b/repair/phase2.c
564d46
@@ -64,7 +64,6 @@ zero_log(xfs_mount_t *mp)
564d46
 		ASSERT(mp->m_sb.sb_logsectlog >= BBSHIFT);
564d46
 	}
564d46
 	log.l_sectbb_mask = (1 << log.l_sectbb_log) - 1;
564d46
-	log.l_sectBBsize = 1 << mp->m_sb.sb_logsectlog;
564d46
 
564d46
 	if ((error = xlog_find_tail(&log, &head_blk, &tail_blk))) {
564d46
 		do_warn(_("zero_log: cannot find log head/tail "
564d46
564d46
_______________________________________________
564d46
xfs mailing list
564d46
xfs@oss.sgi.com
564d46
http://oss.sgi.com/mailman/listinfo/xfs
564d46
564d46