From bf826e6d596f364e5d2ed2cdee5050eb16cc1c49 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 23 Aug 2005 01:50:19 +0000 Subject: [PATCH] Merge vfs_subr.c:1.641 from HEAD to RELENG_6: Silence "busy" warnings when unmounting devfs at system shutdown. This is a workaround for non-symetric teardown of the file systems at shutdown with respect to the mount order at boot. The proper long term fix is to properly detach devfs from the root mount before unmounting each, and should be implemented, but since the problem is non-harmful, this temporary band-aid will prevent false positive bug reports and unnecessary error output for 6.0-RELEASE. Tested by: pav, pjd Approved by: re (scottl) --- sys/kern/vfs_subr.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 1db8b71a4fc3..6da0bca52580 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2711,12 +2711,22 @@ vfs_unmountall() error = dounmount(mp, MNT_FORCE, td); if (error) { TAILQ_REMOVE(&mountlist, mp, mnt_list); - printf("unmount of %s failed (", - mp->mnt_stat.f_mntonname); - if (error == EBUSY) - printf("BUSY)\n"); - else - printf("%d)\n", error); + /* + * XXX: Due to the way in which we mount the root + * file system off of devfs, devfs will generate a + * "busy" warning when we try to unmount it before + * the root. Don't print a warning as a result in + * order to avoid false positive errors that may + * cause needless upset. + */ + if (strcmp(mp->mnt_vfc->vfc_name, "devfs") != 0) { + printf("unmount of %s failed (", + mp->mnt_stat.f_mntonname); + if (error == EBUSY) + printf("BUSY)\n"); + else + printf("%d)\n", error); + } } else { /* The unmount has removed mp from the mountlist */ }