From: Darrick J. Wong Date: Thu, 6 Apr 2017 23:00:39 +0000 (-0700) Subject: xfs: actually report xattr extents via iomap X-Git-Tag: v4.12-rc1~76^2~34 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=84358536dc355a9c8978ee425f87e116186bed16;p=linux.git xfs: actually report xattr extents via iomap 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 Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig --- diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 009f8243dddc..b2f0901bb517 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -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; }