Bug 299095 - growfs: crash during an online grow leaves the filesystem suspended
Summary: growfs: crash during an online grow leaves the filesystem suspended
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-10-03 17:00 UTC by Rick Richard
Modified: 2026-10-07 17:01 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Richard 2026-10-03 17:00:09 UTC
When growfs grows a mounted filesystem it suspends writes to it through
/dev/ufssuspend, and the suspension is lifted when that descriptor is
closed.

If growfs crashes while the filesystem is suspended, the kernel tries
to write the core dump to that same filesystem (the default when growfs
runs from a directory on it) and waits forever for the suspension to
end.  growfs can't be killed and every other write to the filesystem
blocks.

I first hit this with growfs -y / on a Raspberry Pi 3 running 15.1,
where growfs crashes because of the Cortex-A53 erratum (PR 296240).
ssh logins hung, nothing could write to /, and I had to power cycle.

It reproduces on stock 15.1-RELEASE-p3 by crashing growfs on purpose:

  mdconfig -a -t vnode -f /var/tmp/gfs.img     # 3 GB file
  gpart create -s gpt md0; gpart add -t freebsd-ufs -s 512m md0
  newfs -U /dev/md0p1; mount /dev/md0p1 /mnt/t
  gpart resize -i 1 md0
  cd /mnt/t; growfs -y /dev/md0p1 &
  # once growfs has /dev/ufssuspend open:
  kill -SEGV %1

growfs then sits in the suspfs wait, and touch /mnt/t/x blocks too:

  PID STAT WCHAN  COMMAND
 1426 D+   suspfs growfs -y /dev/md0p1

 growfs ... _sleep vn_start_write vn_open_cred core_vn_extend sigexit
     postsig ...

Possible fixes: growfs could set RLIMIT_CORE to 0 before suspending the
filesystem (the kernel skips the dump entirely in that case), but the
general fix is probably for the core dump code not to wait on a
suspended filesystem.  hv_vss_daemon also uses /dev/ufssuspend.
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2026-10-04 00:02:49 UTC
Try https://reviews.freebsd.org/D60283
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-10-07 17:01:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bea382f25b16fec0e9a1c2be130935e739075287

commit bea382f25b16fec0e9a1c2be130935e739075287
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-03 23:59:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-10-07 17:00:53 +0000

    kern/coredump_vnode.c: avoid dumping to the mount point we suspended

    PR:     299095
    Reported by:    Rick Richard <rick@sloservers.com>
    Reviewed by:    markj
    Tested by:      Rick Richard <rick@sloservers.com> (previous version)
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D60283

 sys/kern/vfs_vnops.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)