aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-11-17 06:23:16 +0100
committerChristoph Hellwig <hch@lst.de>2025-03-03 08:16:46 -0700
commitf044dda35124bca5da6d3ad6885ba2c542bfe68f (patch)
tree487426722ba66af70476609157056c5cfbe0a18d
parentxfs: disable sb_frextents for zoned file systems (diff)
downloadwireguard-linux-f044dda35124bca5da6d3ad6885ba2c542bfe68f.tar.xz
wireguard-linux-f044dda35124bca5da6d3ad6885ba2c542bfe68f.zip
xfs: disable FITRIM for zoned RT devices
The zoned allocator unconditionally issues zone resets or discards after emptying an entire zone, so supporting FITRIM for a zoned RT device is not useful. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
-rw-r--r--fs/xfs/xfs_discard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 3f2403a7b49c..c1a306268ae4 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -844,7 +844,8 @@ xfs_ioc_trim(
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (mp->m_rtdev_targp &&
+
+ if (mp->m_rtdev_targp && !xfs_has_zoned(mp) &&
bdev_max_discard_sectors(mp->m_rtdev_targp->bt_bdev))
rt_bdev = mp->m_rtdev_targp->bt_bdev;
if (!bdev_max_discard_sectors(mp->m_ddev_targp->bt_bdev) && !rt_bdev)