xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent
authorJie Liu <jeff.liu@oracle.com>
Thu, 6 Jun 2013 13:24:01 +0000 (06:24 -0700)
committerBen Myers <bpm@sgi.com>
Wed, 19 Jun 2013 19:18:32 +0000 (14:18 -0500)
For FIEMAP ioctl(2), if an extent is in delayed allocation
state, we need to return the FIEMAP_EXTENT_UNKNOWN flag except
the FIEMAP_EXTENT_DELALLOC because its data location is unknown.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_iops.c

index ca9ecaa..c69bbc4 100644 (file)
@@ -987,7 +987,8 @@ xfs_fiemap_format(
        if (bmv->bmv_oflags & BMV_OF_PREALLOC)
                fiemap_flags |= FIEMAP_EXTENT_UNWRITTEN;
        else if (bmv->bmv_oflags & BMV_OF_DELALLOC) {
-               fiemap_flags |= FIEMAP_EXTENT_DELALLOC;
+               fiemap_flags |= (FIEMAP_EXTENT_DELALLOC |
+                                FIEMAP_EXTENT_UNKNOWN);
                physical = 0;   /* no block yet */
        }
        if (bmv->bmv_oflags & BMV_OF_LAST)