From owner-svn-src-all@freebsd.org Sat Dec 23 17:55:20 2017 Return-Path: Delivered-To: svn-src-all@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 6A2B1E8D0AF; Sat, 23 Dec 2017 17:55:20 +0000 (UTC) (envelope-from kan@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 367A76DF7E; Sat, 23 Dec 2017 17:55:20 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNHtJSU096136; Sat, 23 Dec 2017 17:55:19 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNHtJ0M096135; Sat, 23 Dec 2017 17:55:19 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231755.vBNHtJ0M096135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 17:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327114 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 17:55:20 -0000 Author: kan Date: Sat Dec 23 17:55:19 2017 New Revision: 327114 URL: https://svnweb.freebsd.org/changeset/base/327114 Log: Reverse the check to allocate the buffer if cached pointer is NULL. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D13596 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Sat Dec 23 16:49:57 2017 (r327113) +++ head/sys/kern/vfs_export.c Sat Dec 23 17:55:19 2017 (r327114) @@ -412,7 +412,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *ne * If an indexfile was specified, pull it in. */ if (argp->ex_indexfile != NULL) { - if (nfs_pub.np_index != NULL) + if (nfs_pub.np_index == NULL) nfs_pub.np_index = malloc(MAXNAMLEN + 1, M_TEMP, M_WAITOK); error = copyinstr(argp->ex_indexfile, nfs_pub.np_index,