summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2025-03-17 08:44:52 +0300
committerCarlos Maiolino <cem@kernel.org>2025-03-18 15:06:00 +0300
commitbeba9487138151c17dec17105364b35935f21562 (patch)
treea16d468392cdb31132a67e8db3dd5f658bcb38cb
parentfcb255537bee25560af03c583b44866e73a8eb40 (diff)
downloadlinux-beba9487138151c17dec17105364b35935f21562.tar.xz
xfs: fix a missing unlock in xfs_growfs_data
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> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--fs/xfs/xfs_fsops.c8
1 files 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) {