]> git.hungrycats.org Git - linux/commit
xfs: fix agno increment in xfs_inumbers() loop
authorEric Sandeen <sandeen@sandeen.net>
Sun, 12 Oct 2014 23:21:53 +0000 (10:21 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:43:13 +0000 (09:43 -0700)
commit11db06170febdc02fd5cafe88aaaf2a9c7c8404f
treebf3763f83bfa79fdcd8b0394190608b3dfbac4df
parente802422206f5b7ecc49acb35952166e5b6d4de41
xfs: fix agno increment in xfs_inumbers() loop

commit a8b1ee8bafc765ebf029d03c5479a69aebff9693 upstream.

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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_itable.c