From: Matthew Dillon Date: Fri, 20 Aug 2010 05:54:54 +0000 (-0700) Subject: HAMMER VFS - Throw away cached vnodes on stage2 mount failure X-Git-Tag: v2.8.0~478 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9fa352a2b63523ee665c21d3b66cfc47265e9303 HAMMER VFS - Throw away cached vnodes on stage2 mount failure * Make sure all cached vnodes are thrown away before we destroy the mount structure after a stage2 recovery failure. Reported-by: Venkatesh Srinivas --- diff --git a/sys/vfs/hammer/hammer_vfsops.c b/sys/vfs/hammer/hammer_vfsops.c index c5354e8..ff591d6 100644 --- a/sys/vfs/hammer/hammer_vfsops.c +++ b/sys/vfs/hammer/hammer_vfsops.c @@ -727,6 +727,14 @@ hammer_vfs_mount(struct mount *mp, char *mntpt, caddr_t data, if (hmp->ronly == 0) error = hammer_recover_stage2(hmp, rootvol); + /* + * If the stage2 recovery fails be sure to clean out all cached + * vnodes before throwing away the mount structure or bad things + * will happen. + */ + if (error) + vflush(mp, 0, 0); + done: hammer_rel_volume(rootvol, 0); failed: