xfs: actually report xattr extents via iomap
PATCH v2 1/1 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 <[email protected]>
--- fs/xfs/xfs_iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_iomap.c +2 -2
@@ -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; }
Quoted 6 lines · Darrick J. Wong
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 <[email protected]>---
Reviewed-by Brian Foster <[email protected]>
Quoted 20 lines
fs/xfs/xfs_iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/xfs/xfs_iomap.c +2
-2@@ -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; }
I still think this isn't a feature we should support. For debug we already have our xfs ioctl..
But if you want to keep it around:
Reviewed-by Christoph Hellwig <[email protected]>