iomap: prepare iomap_fiemap for attribute mappings
authorDave Chinner <dchinner@redhat.com>
Tue, 16 Aug 2016 22:41:34 +0000 (08:41 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 16 Aug 2016 22:41:34 +0000 (08:41 +1000)
By bassing through an -ENOENT, similar to the old XFS implementation of
FIEMAP_FLAG_XATTR.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[hch: split from a larger patch]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/iomap.c

index 56c19e617a265370cb395e939e78f1772eb49f10..d9d1f50c36aaa1123061f0bde1128e41489e1c59 100644 (file)
@@ -476,6 +476,9 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
        while (len > 0) {
                ret = iomap_apply(inode, start, len, 0, ops, &ctx,
                                iomap_fiemap_actor);
+               /* inode with no (attribute) mapping will give ENOENT */
+               if (ret == -ENOENT)
+                       break;
                if (ret < 0)
                        return ret;
                if (ret == 0)