xfsprogs: remove incorrect l_sectBBsize assignment in xfs_repair
PATCH 1/1 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).
---
repair/phase2.c +0 -1
@@ -64,7 +64,6 @@ zero_log(xfs_mount_t *mp)ASSERT (mp->m_sb.sb_logsectlog >=BBSHIFT ); } log.l_sectbb_mask = (1 << log.l_sectbb_log) -1 ; - log.l_sectBBsize =1 << mp->m_sb.sb_logsectlog;if ((error =xlog_find_tail (&log, &head_blk, &tail_blk))) { do_warn(_("zero_log: cannot find log head/tail "
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
This looks good to me,
Quoted 52 lines · Eric Sandeen
Commit
e0607266xfsprogs: add crc format support to repairadded a 2nd assignment to
l_sectBBsize:log.l_sectBBsize = 1 << mp->m_sb.sb_logsectlog;which is incorrect;
sb_logsectlogis log2 of the sector size, in bytes;l_sectBBsizeis 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 causedxfs_repairto think that a log was dirty even when it was clean:"ERROR: The filesystem has valuable metadata changes in a log"
(
xfs_logprintdidn't have this error, soxfs_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_logsectlogto "0" rather than 9, sol_sectBBsizecame out to "1" (as in 1 sector), as it should have).Reporteed-by Markus Trippelsdorf <[email protected]>Signed-off-by Eric Sandeen <[email protected]>---
repair/phase2.c +0
-1@@ -64,7 +64,6 @@ zero_log(xfs_mount_t *mp)ASSERT (mp->m_sb.sb_logsectlog >=BBSHIFT ); } log.l_sectbb_mask = (1 << log.l_sectbb_log) -1 ; - log.l_sectBBsize =1 << mp->m_sb.sb_logsectlog;if ((error =xlog_find_tail (&log, &head_blk, &tail_blk))) { do_warn(_("zero_log: cannot find log head/tail "_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Signature · 6 lines
Carlos _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Eric Sandeen
Commit
e0607266xfsprogs: add crc format support to repairadded a 2nd assignment to
l_sectBBsize:log.l_sectBBsize = 1 << mp->m_sb.sb_logsectlog;which is incorrect;
sb_logsectlogis log2 of the sector size, in bytes;l_sectBBsizeis the size of the log sector in 512-byte units.
Yes, that is wrong. It looks like a hunk of code I didn't cleanup properly when I did some patch reordering and rebasing. IIRC, the above patch was written before I realised that all of xfsprogs failed to handle log sector sizes != 512 bytes properly, and that the log CRC code required that to work correctly. Hence a generic fix to the problem was added in commit:
999f0b9 xfsprogs: updata libxlog to current kernel code
Which fixed repair, db and logprint. That is where this code:
Quoted 6 lines
Just remove the incorrect assignment; it was already properly assigned about 12 lines prior:
log.l_sectBBsize = BTOBB(x.lbsize);and things work again.
came from.
Basically, I didn't clean all the random fix fragments out of the repair patch, and so I broke log secotr size != 512 byte cases for repair again....
Quoted 1 line
Reporteed-by Markus Trippelsdorf <[email protected]>
Reported-by the reportee. ;)
Quoted 8 lines
Signed-off-by Eric Sandeen <[email protected]>---
repair/phase2.c +0
-0
repair/phase2.c zero_log(xfs_mount_t *mp) · line 69
Quoted 7 lines
repair/phase2.c +0
-1@@ -64,7 +64,6 @@ zero_log(xfs_mount_t *mp)ASSERT (mp->m_sb.sb_logsectlog >=BBSHIFT ); } log.l_sectbb_mask = (1 << log.l_sectbb_log) -1 ; - log.l_sectBBsize =1 << mp->m_sb.sb_logsectlog;if ((error =xlog_find_tail (&log, &head_blk, &tail_blk))) { do_warn(_("zero_log: cannot find log head/tail "
Looks good,
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
This has been committed.
Thanks
--Rich
commit 5425725c56bccb9a91847cb74cfdadc8b44fecf7
Author: Eric Sandeen <[email protected]> Date: Mon Oct 7 17:35:16 2013 +0000
xfsprogs: remove incorrect l_sectBBsize assignment in xfs_repair
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs