Skip to content

Commit

Permalink
Remove wrong assertion in log spacemap
Browse files Browse the repository at this point in the history
It is typical, but not generally true that if log summary has more
blocks it must also have unflushed metaslabs.  Normally with metaslabs
flushed in order it works, but there are known exceptions, such as
device removal or metaslab being loaded during its flush attempt.

Before 600a02b if spa_flush_metaslabs() hit loading metaslab it
usually stopped (unless memlimit is also exceeded), but now it may
flush more metaslabs, just skipping that particular one.  This
increased chances of assertion to fire when the skipped metaslab is
flushed on next iteration if all other metaslabs in that summary
entry are already flushed out of order.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes openzfs#13486 
Closes openzfs#13513
  • Loading branch information
amotin authored and snajpa committed Oct 22, 2022
1 parent 4f29185 commit 60176a2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions module/zfs/spa_log_spacemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,6 @@ spa_log_summary_decrement_blkcount(spa_t *spa, uint64_t blocks_gone)
for (log_summary_entry_t *e = list_head(&spa->spa_log_summary);
e != NULL; e = list_head(&spa->spa_log_summary)) {
if (e->lse_blkcount > blocks_gone) {
/*
* Assert that we stopped at an entry that is not
* obsolete.
*/
ASSERT(e->lse_mscount != 0);

e->lse_blkcount -= blocks_gone;
blocks_gone = 0;
break;
Expand Down

0 comments on commit 60176a2

Please sign in to comment.