]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: pass state not whichfork to trace_xfs_extlist
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Jan 2017 02:18:48 +0000 (20:18 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:18:48 +0000 (20:18 -0600)
Source kernel commit: 7710517fc37b1899722707883b54694ea710b3c0

When xfs_bmap_trace_exlist called trace_xfs_extlist,
it sent in the "whichfork" var instead of the bmap "state"
as expected (even though state was already set up for this
purpose).

As a result, the xfs_bmap_class in tracing code used
"whichfork" not state in xfs_iext_state_to_fork(), and got
the wrong ifork pointer.  It all goes downhill from
there, including an ASSERT when ifp_bytes is empty
by the time it reaches xfs_iext_get_ext():

XFS: Assertion failed: idx < ifp->if_bytes / sizeof(xfs_bmbt_rec_t)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c

index 316d8acf582db37e49666e441b4736e5ceb9ca64..4417da8850554b99ee40f7986f67d9348c10d4b5 100644 (file)
@@ -522,7 +522,7 @@ xfs_bmap_trace_exlist(
        ifp = XFS_IFORK_PTR(ip, whichfork);
        ASSERT(cnt == xfs_iext_count(ifp));
        for (idx = 0; idx < cnt; idx++)
-               trace_xfs_extlist(ip, idx, whichfork, caller_ip);
+               trace_xfs_extlist(ip, idx, state, caller_ip);
 }
 
 /*