Skip to content

Commit 8e5a244

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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>
1 parent 7d52325 commit 8e5a244

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/xfs/xfs_aops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ xfs_vm_swap_activate(
760760
{
761761
struct xfs_inode *ip = XFS_I(file_inode(swap_file));
762762

763+
if (xfs_is_zoned_inode(ip))
764+
return -EINVAL;
765+
763766
/*
764767
* Swap file activation can race against concurrent shared extent
765768
* removal in files that have been cloned. If this happens,

0 commit comments

Comments
 (0)