From 3881e732a9b39d75cafba3afffc348e2aeb85dde Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Tue, 4 Sep 2012 12:11:54 +0000 Subject: [PATCH] VFS: panic when unmount_all fails --- servers/vfs/mount.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index 93b2b664b..217dba891 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -453,7 +453,7 @@ int do_umount(void) /*===========================================================================* - * unmount * + * unmount * *===========================================================================*/ int unmount( dev_t dev, /* block-special device */ @@ -551,10 +551,20 @@ void unmount_all(void) unmount(vmp->m_dev, NULL); } } + + /* Verify nothing is locked anymore */ check_vnode_locks(); check_vmnt_locks(); check_filp_locks(); check_bsf_lock(); + + /* Verify we succesfully unmounted all file systems */ + for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) { + if (vmp->m_dev != NO_DEV) { + panic("vmp still mounted: %s %d %d\n", vmp->m_label, + vmp->m_fs_e, vmp->m_dev); + } + } } /*===========================================================================*