]> git.hungrycats.org Git - linux/commitdiff
xfs: actually report xattr extents via iomap
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 6 Apr 2017 23:00:39 +0000 (16:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Jun 2017 10:10:14 +0000 (12:10 +0200)
commit 84358536dc355a9c8978ee425f87e116186bed16 upstream.

Apparently FIEMAP for xattrs has been broken since we switched to
the iomap backend because of an incorrect check for xattr presence.
Also fix the broken locking.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_iomap.c

index 288ee5b840d738116b8981e9618fac36fb24614f..79e6dfac3dd6989b2490b0357b14d12bb7575736 100644 (file)
@@ -1170,10 +1170,10 @@ xfs_xattr_iomap_begin(
        if (XFS_FORCED_SHUTDOWN(mp))
                return -EIO;
 
-       lockmode = xfs_ilock_data_map_shared(ip);
+       lockmode = xfs_ilock_attr_map_shared(ip);
 
        /* if there are no attribute fork or extents, return ENOENT */
-       if (XFS_IFORK_Q(ip) || !ip->i_d.di_anextents) {
+       if (!XFS_IFORK_Q(ip) || !ip->i_d.di_anextents) {
                error = -ENOENT;
                goto out_unlock;
        }