* [bug report] xfs: allow internal RT devices for zoned mode
@ 2025-03-13 8:42 Dan Carpenter
2025-03-13 8:45 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-03-13 8:42 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-xfs
Hello Christoph Hellwig,
Commit bdc03eb5f98f ("xfs: allow internal RT devices for zoned mode")
from Nov 17, 2024 (linux-next), leads to the following Smatch static
checker warning:
fs/xfs/xfs_fsops.c:347 xfs_growfs_data()
warn: inconsistent returns '&mp->m_growlock'.
fs/xfs/xfs_fsops.c
299 int
300 xfs_growfs_data(
301 struct xfs_mount *mp,
302 struct xfs_growfs_data *in)
303 {
304 int error = 0;
305
306 if (!capable(CAP_SYS_ADMIN))
307 return -EPERM;
308 if (!mutex_trylock(&mp->m_growlock))
309 return -EWOULDBLOCK;
310
311 /* 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;
goto out_error?
314
315 /* update imaxpct separately to the physical grow of the filesystem */
316 if (in->imaxpct != mp->m_sb.sb_imax_pct) {
317 error = xfs_growfs_imaxpct(mp, in->imaxpct);
318 if (error)
319 goto out_error;
320 }
321
322 if (in->newblocks != mp->m_sb.sb_dblocks) {
323 error = xfs_growfs_data_private(mp, in);
324 if (error)
325 goto out_error;
326 }
327
328 /* Post growfs calculations needed to reflect new state in operations */
329 if (mp->m_sb.sb_imax_pct) {
330 uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct;
331 do_div(icount, 100);
332 M_IGEO(mp)->maxicount = XFS_FSB_TO_INO(mp, icount);
333 } else
334 M_IGEO(mp)->maxicount = 0;
335
336 /* Update secondary superblocks now the physical grow has completed */
337 error = xfs_update_secondary_sbs(mp);
338
339 out_error:
340 /*
341 * Increment the generation unconditionally, the error could be from
342 * updating the secondary superblocks, in which case the new size
343 * is live already.
344 */
345 mp->m_generation++;
346 mutex_unlock(&mp->m_growlock);
--> 347 return error;
348 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] xfs: allow internal RT devices for zoned mode
2025-03-13 8:42 [bug report] xfs: allow internal RT devices for zoned mode Dan Carpenter
@ 2025-03-13 8:45 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2025-03-13 8:45 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Christoph Hellwig, linux-xfs
On Thu, Mar 13, 2025 at 11:42:31AM +0300, Dan Carpenter wrote:
> Hello Christoph Hellwig,
>
> Commit bdc03eb5f98f ("xfs: allow internal RT devices for zoned mode")
> from Nov 17, 2024 (linux-next), leads to the following Smatch static
> checker warning:
Yeah. I'm pretty sure you reported it before and I thought I had fixed
it, but I guess that got lost again somehow. I'll take care of it
and thanks for the reminder!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-13 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 8:42 [bug report] xfs: allow internal RT devices for zoned mode Dan Carpenter
2025-03-13 8:45 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox