xfs: reject swapon for inodes on a zoned file system earlier

No point in going down into the iomap mapping loop when we know it
will be rejected.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>

authored by Christoph Hellwig and committed by Carlos Maiolino 8e5a2441 7d523255

+3
+3
fs/xfs/xfs_aops.c
··· 760 { 761 struct xfs_inode *ip = XFS_I(file_inode(swap_file)); 762 763 /* 764 * Swap file activation can race against concurrent shared extent 765 * removal in files that have been cloned. If this happens,
··· 760 { 761 struct xfs_inode *ip = XFS_I(file_inode(swap_file)); 762 763 + if (xfs_is_zoned_inode(ip)) 764 + return -EINVAL; 765 + 766 /* 767 * Swap file activation can race against concurrent shared extent 768 * removal in files that have been cloned. If this happens,