xfs: handle cow fork in xfs_bmap_trace_exlist
authorEric Sandeen <sandeen@sandeen.net>
Mon, 5 Dec 2016 01:32:00 +0000 (12:32 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 5 Dec 2016 01:32:00 +0000 (12:32 +1100)
By inspection, xfs_bmap_trace_exlist isn't handling cow forks,
and will trace the data fork instead.

Fix this by setting state appropriately if whichfork
== XFS_COW_FORK.

()___()
< @ @ >
 |   |
 {o_o}
  (|)

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

index e4120fcefcc893a44a6c6bd2014fe7bde61a0d8c..23aa70b2790cfaff0222279e4cce5e034c55175d 100644 (file)
@@ -518,7 +518,7 @@ void
 xfs_bmap_trace_exlist(
        xfs_inode_t     *ip,            /* incore inode pointer */
        xfs_extnum_t    cnt,            /* count of entries in the list */
-       int             whichfork,      /* data or attr fork */
+       int             whichfork,      /* data or attr or cow fork */
        unsigned long   caller_ip)
 {
        xfs_extnum_t    idx;            /* extent record index */
@@ -527,6 +527,8 @@ xfs_bmap_trace_exlist(
 
        if (whichfork == XFS_ATTR_FORK)
                state |= BMAP_ATTRFORK;
+       else if (whichfork == XFS_COW_FORK)
+               state |= BMAP_COWFORK;
 
        ifp = XFS_IFORK_PTR(ip, whichfork);
        ASSERT(cnt == xfs_iext_count(ifp));