From owner-cvs-src-old@FreeBSD.ORG Thu Sep 24 15:56:39 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CD810657BB for ; Thu, 24 Sep 2009 15:56:39 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 757BD8FC13 for ; Thu, 24 Sep 2009 15:56:39 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n8OFudOC043633 for ; Thu, 24 Sep 2009 15:56:39 GMT (envelope-from pjd@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n8OFud0D043631 for cvs-src-old@freebsd.org; Thu, 24 Sep 2009 15:56:39 GMT (envelope-from pjd@repoman.freebsd.org) Message-Id: <200909241556.n8OFud0D043631@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to pjd@repoman.freebsd.org using -f From: Pawel Jakub Dawidek Date: Thu, 24 Sep 2009 15:56:26 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_vfsops.c src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys zfs_znode.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 15:56:39 -0000 pjd 2009-09-24 15:56:26 UTC FreeBSD src repository Modified files: sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_vfsops.c sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys zfs_znode.h Log: SVN rev 197459 on 2009-09-24 15:56:26Z by pjd Before calling vflush(FORCECLOSE) mark file system as unmounted so the following vnops will fail. This is very important, because without this change vnode could be reclaimed at any point, even if we increased usecount. The only way to ensure that vnode won't be reclaimed was to lock it, which would be very hard to do in ZFS without changing a lot of code. With this change simply increasing usecount is enough to be sure vnode won't be reclaimed from under us. To be precise it can still be reclaimed but we won't be able to see it, because every try to enter ZFS through VFS will result in EIO. The only function that cannot return EIO, because it is needed for vflush() is zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks z_teardown_lock and never returns EIO. MFC after: 3 days Revision Changes Path 1.7 +4 -0 src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h 1.32 +12 -1 src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c