Re: vnode_put(...): iocount < 1 revisited
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com
Thanks for your comments. I think it all makes sense. I took some time to correlate your comments with the code. I agree that I needed the vnode_recycle(). In fact, vnop_remove() in my driver behaves the same way. I am still unsure about how the last iocount gets dropped. If there is no open() again, the vnode never gets recycled? I will keep looking at the code.
If the vnode is in this situation (doesn't really exist except in local namecache), then the iocount acquired in cache_lookup() will be dropped in vn_auth_open() (see the vnode_put() at vfs_vnops.c:454, at least in my copy of vfs_vnops.c). If the open succeeds, then eventually the iocount will be dropped in open1() (vfs_syscalls.c). Of course if the open _does_ succeed then the vnode will still have a usecount. It occurs to me that you should actually also purge that vnode from the namecache as well when you call vnode_recycle() (even though when the vnode is recycled it will do that); the vnode might have a usecount and it can't be recycled until both the usecount and the iocount reach zero. If that happened then you'd still be stuck in that loop until the other owners of that vnode were done with it. --Ken _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Ken Hornstein