]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: reject swapon for inodes on a zoned file system earlier
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Aug 2025 05:06:45 +0000 (07:06 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 19 Aug 2025 12:38:39 +0000 (14:38 +0200)
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>
fs/xfs/xfs_aops.c

index 1ee4f835ac3c37d64ca2ca9ea8f242b572c3ade8..a26f798155331f8f574d2d5eb6e8d1db19665c0d 100644 (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,