2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

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>
This commit is contained in:
Christoph Hellwig 2025-08-18 07:06:45 +02:00 committed by Carlos Maiolino
parent 7d523255f5
commit 8e5a2441e1

View File

@ -760,6 +760,9 @@ xfs_vm_swap_activate(
{
struct xfs_inode *ip = XFS_I(file_inode(swap_file));
if (xfs_is_zoned_inode(ip))
return -EINVAL;
/*
* Swap file activation can race against concurrent shared extent
* removal in files that have been cloned. If this happens,