]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: fix a missing unlock in xfs_growfs_data
authorChristoph Hellwig <hch@lst.de>
Mon, 17 Mar 2025 05:44:52 +0000 (06:44 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 18 Mar 2025 12:06:00 +0000 (13:06 +0100)
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>
fs/xfs/xfs_fsops.c

index ee2cefbd5df8ac9d9a4d9a548a0fd8fe205a3180..d7658b7dcdbd084e0dbc8eba78eb054cca421251 100644 (file)
@@ -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) {