Skip to content

Commit beba948

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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: bdc03eb ("xfs: allow internal RT devices for zoned mode") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent fcb2555 commit beba948

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/xfs/xfs_fsops.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,18 @@ xfs_growfs_data(
301301
struct xfs_mount *mp,
302302
struct xfs_growfs_data *in)
303303
{
304-
int error = 0;
304+
int error;
305305

306306
if (!capable(CAP_SYS_ADMIN))
307307
return -EPERM;
308308
if (!mutex_trylock(&mp->m_growlock))
309309
return -EWOULDBLOCK;
310310

311311
/* we can't grow the data section when an internal RT section exists */
312-
if (in->newblocks != mp->m_sb.sb_dblocks && mp->m_sb.sb_rtstart)
313-
return -EINVAL;
312+
if (in->newblocks != mp->m_sb.sb_dblocks && mp->m_sb.sb_rtstart) {
313+
error = -EINVAL;
314+
goto out_error;
315+
}
314316

315317
/* update imaxpct separately to the physical grow of the filesystem */
316318
if (in->imaxpct != mp->m_sb.sb_imax_pct) {

0 commit comments

Comments
 (0)