From owner-svn-src-head@freebsd.org Wed Sep 21 05:44:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1BB5BE3A8A; Wed, 21 Sep 2016 05:44:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4350A67; Wed, 21 Sep 2016 05:44:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8L5iDnZ090526; Wed, 21 Sep 2016 05:44:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8L5iDMl090525; Wed, 21 Sep 2016 05:44:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201609210544.u8L5iDMl090525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 21 Sep 2016 05:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306071 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 05:44:15 -0000 Author: trasz Date: Wed Sep 21 05:44:13 2016 New Revision: 306071 URL: https://svnweb.freebsd.org/changeset/base/306071 Log: Fix bug introduced with r302388, which could cause processes accessing automounted shares to hang with "vfs_busy" wchan. (As a workaround one can run 'automount -u' from cron.) Reviewed by: kib@ MFC after: 1 month Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Sep 21 05:33:18 2016 (r306070) +++ head/sys/kern/vfs_mount.c Wed Sep 21 05:44:13 2016 (r306071) @@ -1207,6 +1207,9 @@ sys_unmount(struct thread *td, struct un /* * Return error if any of the vnodes, ignoring the root vnode * and the syncer vnode, have non-zero usecount. + * + * This function is purely advisory - it can return false positives + * and negatives. */ static int vfs_check_usecounts(struct mount *mp) @@ -1288,6 +1291,10 @@ dounmount(struct mount *mp, int flags, s MNT_ILOCK(mp); if (error != 0) { mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ); + if (mp->mnt_kern_flag & MNTK_MWAIT) { + mp->mnt_kern_flag &= ~MNTK_MWAIT; + wakeup(mp); + } MNT_IUNLOCK(mp); if (coveredvp != NULL) { VOP_UNLOCK(coveredvp, 0);