xfs: handle "raw" delayed extents xfs_reflink_trim_around_shared
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 04:52:00 +0000 (15:52 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 20 Oct 2016 04:52:00 +0000 (15:52 +1100)
Delalloc extents in the extent list contain the number of reserved
indirect blocks in their startblock value and don't use the magic
DELAYSTARTBLOCK constant.  Ensure that xfs_reflink_trim_around_shared
handles them properly by checking for isnullstartblock().

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_reflink.c

index 6592daa833a406648a85aa03d4b158d7d9e52b13..6c4c215634ec6345e54ec4fcab12a4d4d347be8c 100644 (file)
@@ -182,7 +182,8 @@ xfs_reflink_trim_around_shared(
        if (!xfs_is_reflink_inode(ip) ||
            ISUNWRITTEN(irec) ||
            irec->br_startblock == HOLESTARTBLOCK ||
-           irec->br_startblock == DELAYSTARTBLOCK) {
+           irec->br_startblock == DELAYSTARTBLOCK ||
+           isnullstartblock(irec->br_startblock)) {
                *shared = false;
                return 0;
        }