Index: hostfs_kern.c =================================================================== --- hostfs_kern.c (revision 8135) +++ hostfs_kern.c (working copy) @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "hostfs.h" #include "kern_util.h" @@ -1037,3 +1038,17 @@ module_init(init_hostfs) module_exit(exit_hostfs) MODULE_LICENSE("GPL"); + +static void hostfs_exitcall(void) +{ + struct super_block *root_sb = current->fs->rootmnt->mnt_sb; + if (root_sb->s_type == &hostfs_type) { + struct inode *inode; + list_for_each_entry(inode, &root_sb->s_inodes, i_sb_list) { + if(HOSTFS_I(inode)->fd != -1) { + close_file(&HOSTFS_I(inode)->fd); + } + } + } +} +__uml_exitcall(hostfs_exitcall);