From owner-freebsd-arch@FreeBSD.ORG Thu Mar 5 05:44:45 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D2C3106566B for ; Thu, 5 Mar 2009 05:44:45 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id 18D9F8FC19 for ; Thu, 5 Mar 2009 05:44:44 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by rv-out-0506.google.com with SMTP id f6so4218459rvb.43 for ; Wed, 04 Mar 2009 21:44:44 -0800 (PST) Received: by 10.141.176.4 with SMTP id d4mr409295rvp.5.1236230404702; Wed, 04 Mar 2009 21:20:04 -0800 (PST) Received: from ?10.0.1.198? (udp016664uds.hawaiiantel.net [72.235.41.117]) by mx.google.com with ESMTPS id b8sm10842904rvf.8.2009.03.04.21.20.02 (version=SSLv3 cipher=RC4-MD5); Wed, 04 Mar 2009 21:20:03 -0800 (PST) Date: Wed, 4 Mar 2009 19:16:46 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Matthew Fleming In-Reply-To: <06D5F9F6F655AD4C92E28B662F7F853E0275F637@seaxch09.desktop.isilon.com> Message-ID: References: <06D5F9F6F655AD4C92E28B662F7F853E0275F637@seaxch09.desktop.isilon.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org Subject: Re: knotes and force unmount X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2009 05:44:45 -0000 On Wed, 4 Mar 2009, Matthew Fleming wrote: > At close() time knote_fdclose() will take care of any outstanding knotes > for the file by looping over the list, calling kn_fop->f_detach and then > knote_drop(). For a umount -f, there may still be open files; these > will be handled in vgonel() by a call to VOP_CLOSE(). knotes are > untouched in this case. > > If the filesystem is from a loadable module, then the knotes need to be > cleaned up before the module is unloaded to prevent a callout into code > that no longer exists, when the file is later closed. So it seems like > there is code missing from vgonel() that should be doing this for the > case where it calls VOP_CLOSE(). I realize this isn't a problem for ufs > (never unloaded because it's used for /) and NFS (no events), but for > any other filesystem this seems like a hole in the force unmount story. > > Is this interpretation correct? It would always be possible to add code > to a filesystem's vop_close routine or its unmount routine, but > architecturally this seems like something that should be handled at > vgonel->VOP_CLOSE time, because it's a problem for any loadable > filesystem with events. Hi Matthew, This is actually a problem for any VOP with "U U U" in the vnode_if.src specification. Forced unmounts are delayed by vnode locks held but several vops don't hold vnode locks and instead rely on other locking. We have the same problem with loadable syscalls. How can you tell when the code is no longer in use? The right answer would probably be to wait for every thread that is currently in a syscall to leave once before unloading completely. This would solve syscalls and your loadable module case. Although it would be complicated by nfs which doesn't use syscalls but does issue VOPs. I believe a general solution for syscalls/loadable modules would solve this case. Don't you think? I thought Isilon already did something for this? Or is this something you're only discovering since you've merged? If you're interested in working on this I can help you implement a general solution. Thanks, Jeff > > Thanks, > matthew > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" >