diff mbox series

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

Message ID 20241211085636.1380516-18-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/43] xfs: constify feature checks | expand

Commit Message

Christoph Hellwig Dec. 11, 2024, 8:54 a.m. UTC
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(+)

Comments

Darrick J. Wong Dec. 12, 2024, 10:07 p.m. UTC | #1
On Wed, Dec 11, 2024 at 09:54:42AM +0100, Christoph Hellwig wrote:
> Because the RT blocks follow right after.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Aha, I was wondering about that.  Does this belong in the previous
patch?

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  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
> 
>
Christoph Hellwig Dec. 13, 2024, 5:22 a.m. UTC | #2
On Thu, Dec 12, 2024 at 02:07:27PM -0800, Darrick J. Wong wrote:
> On Wed, Dec 11, 2024 at 09:54:42AM +0100, Christoph Hellwig wrote:
> > Because the RT blocks follow right after.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Aha, I was wondering about that.  Does this belong in the previous
> patch?

Sure.
diff mbox series

Patch

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);