瀏覽代碼

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 <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong 8 年之前
父節點
當前提交
84358536dc
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      fs/xfs/xfs_iomap.c

+ 2 - 2
fs/xfs/xfs_iomap.c

@@ -1170,10 +1170,10 @@ xfs_xattr_iomap_begin(
 	if (XFS_FORCED_SHUTDOWN(mp))
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return -EIO;
 		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 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;
 		error = -ENOENT;
 		goto out_unlock;
 		goto out_unlock;
 	}
 	}