[PATCH 17/43] xfs: don't allow growfs of the data device with internal RT device

Christoph Hellwig
2024-12-11T08:57:23Z

Because the RT blocks follow right after.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/xfs_fsops.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index bb2e31e338b8..3c04fee284e2 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -307,6 +307,10 @@ xfs_growfs_data(
if (!mutex_trylock(&mp->m_growlock))
return -EWOULDBLOCK;

+ /* we can't grow the data section when an internal RT section exists */
+ if (in->newblocks != mp->m_sb.sb_dblocks && mp->m_sb.sb_rtstart)
+ return -EINVAL;
+
/* update imaxpct separately to the physical grow of the filesystem */
if (in->imaxpct != mp->m_sb.sb_imax_pct) {
error = xfs_growfs_imaxpct(mp, in->imaxpct);
--
2.45.2