Skip to content

Commit

Permalink
xfs: fix agno increment in xfs_inumbers() loop
Browse files Browse the repository at this point in the history
caused a regression in xfs_inumbers, which in turn broke
xfsdump, causing incomplete dumps.

The loop in xfs_inumbers() needs to fill the user-supplied
buffers, and iterates via xfs_btree_increment, reading new
ags as needed.

But the first time through the loop, if xfs_btree_increment()
succeeds, we continue, which triggers the ++agno at the bottom
of the loop, and we skip to soon to the next ag - without
the proper setup under next_ag to read the next ag.

Fix this by removing the agno increment from the loop conditional,
and only increment agno if we have actually hit the code under
the next_ag: target.

Cc: [email protected]
Signed-off-by: Eric Sandeen <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
  • Loading branch information
sandeen authored and dchinner committed Oct 12, 2014
1 parent 5217793 commit a8b1ee8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ xfs_inumbers(
xfs_buf_relse(agbp);
agbp = NULL;
agino = 0;
} while (++agno < mp->m_sb.sb_agcount);
agno++;
} while (agno < mp->m_sb.sb_agcount);

if (!error) {
if (bufidx) {
Expand Down

0 comments on commit a8b1ee8

Please sign in to comment.