From 740a720142d8c49ade36eab8d5a7ebcb2f6c5691 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 28 Feb 2010 17:10:41 +0000 Subject: [PATCH] In msdosfs_inactive(), reclaim the vnodes both for SLOT_DELETED and SLOT_EMPTY deName[0] values. Besides conforming to FAT specification, it also clears the issue where vfs_hash_insert found the vnode in hash, and newly allocated vnode is vput()ed. There, deName[0] == 0, and vnode is not reclaimed, indefinitely kept on mountlist. Tested by: pho MFC after: 3 weeks --- sys/fs/msdosfs/msdosfs_denode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 0399a595e51b..ed24d492029e 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -593,7 +593,7 @@ msdosfs_inactive(ap) /* * Ignore denodes related to stale file handles. */ - if (dep->de_Name[0] == SLOT_DELETED) + if (dep->de_Name[0] == SLOT_DELETED || dep->de_Name[0] == SLOT_EMPTY) goto out; /* @@ -621,7 +621,7 @@ out: printf("msdosfs_inactive(): v_usecount %d, de_Name[0] %x\n", vrefcnt(vp), dep->de_Name[0]); #endif - if (dep->de_Name[0] == SLOT_DELETED) + if (dep->de_Name[0] == SLOT_DELETED || dep->de_Name[0] == SLOT_EMPTY) vrecycle(vp, td); return (error); }