softdep_mount: report failure of the softdepflush thread creation

and do not hang waiting forever for an ack from non-existing thread.

PR:	281511
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2024-09-15 11:06:31 +03:00
parent 8276c6ea9c
commit 4b273a7fb9
1 changed files with 9 additions and 1 deletions

View File

@ -2642,10 +2642,18 @@ softdep_mount(struct vnode *devvp,
ACQUIRE_LOCK(ump);
ump->softdep_flags |= FLUSH_STARTING;
FREE_LOCK(ump);
kproc_kthread_add(&softdep_flush, mp, &bufdaemonproc,
error = kproc_kthread_add(&softdep_flush, mp, &bufdaemonproc,
&ump->softdep_flushtd, 0, 0, "softdepflush", "%s worker",
mp->mnt_stat.f_mntonname);
ACQUIRE_LOCK(ump);
if (error != 0) {
printf("%s: failed to start softdepflush thread: %d\n",
mp->mnt_stat.f_mntonname, error);
ump->softdep_flags &= ~FLUSH_STARTING;
FREE_LOCK(ump);
softdep_unmount(mp);
return (error);
}
while ((ump->softdep_flags & FLUSH_STARTING) != 0) {
msleep(&ump->softdep_flushtd, LOCK_PTR(ump), PVM, "sdstart",
hz / 2);