Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Carlos Maiolino <cem@kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Hans Holmberg <hans.holmberg@wdc.com>,
	linux-xfs@vger.kernel.org
Subject: [PATCH 1/3] xfs: fix a missing unlock in xfs_growfs_data
Date: Mon, 17 Mar 2025 06:44:52 +0100	[thread overview]
Message-ID: <20250317054512.1131950-2-hch@lst.de> (raw)
In-Reply-To: <20250317054512.1131950-1-hch@lst.de>

The newly added check for the internal RT device needs to unlock
m_growlock just like all ther other error cases.

Fixes: bdc03eb5f98f ("xfs: allow internal RT devices for zoned mode")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_fsops.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index ee2cefbd5df8..d7658b7dcdbd 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -301,7 +301,7 @@ xfs_growfs_data(
 	struct xfs_mount	*mp,
 	struct xfs_growfs_data	*in)
 {
-	int			error = 0;
+	int			error;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
@@ -309,8 +309,10 @@ xfs_growfs_data(
 		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;
+	if (in->newblocks != mp->m_sb.sb_dblocks && mp->m_sb.sb_rtstart) {
+		error = -EINVAL;
+		goto out_error;
+	}
 
 	/* update imaxpct separately to the physical grow of the filesystem */
 	if (in->imaxpct != mp->m_sb.sb_imax_pct) {
-- 
2.45.2


  reply	other threads:[~2025-03-17  5:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17  5:44 zoned fixes Christoph Hellwig
2025-03-17  5:44 ` Christoph Hellwig [this message]
2025-03-18 11:54   ` [PATCH 1/3] xfs: fix a missing unlock in xfs_growfs_data Carlos Maiolino
2025-03-24  8:52   ` Carlos Maiolino
2025-03-17  5:44 ` [PATCH 2/3] xfs: don't increment m_generation for all errors " Christoph Hellwig
2025-03-18 12:01   ` Carlos Maiolino
2025-03-17  5:44 ` [PATCH 3/3] xfs: don't wake zone space waiters without m_zone_info Christoph Hellwig
2025-03-17 14:46   ` Hans Holmberg
2025-03-18 12:04   ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317054512.1131950-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=cem@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=djwong@kernel.org \
    --cc=hans.holmberg@wdc.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox