From owner-freebsd-current@freebsd.org Fri Dec 21 01:20:15 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36EB1337717 for ; Fri, 21 Dec 2018 01:20:15 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (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 8B06877129; Fri, 21 Dec 2018 01:20:14 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id wBL1SjfA041538; Thu, 20 Dec 2018 17:28:45 -0800 (PST) (envelope-from mckusick@mckusick.com) Message-Id: <201812210128.wBL1SjfA041538@chez.mckusick.com> From: Kirk McKusick To: Rebecca Cran , Mark Johnston Subject: Re: Panic in getblkx() booting from disc1.iso in Qemu VM cc: pho@freebsd.org, "freebsd-current@FreeBSD.org" X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: <20181220180449.GD98252@raichu> Comments: In-reply-to Mark Johnston message dated "Thu, 20 Dec 2018 13:04:49 -0500." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <41536.1545355725.1@chez.mckusick.com> Date: Thu, 20 Dec 2018 17:28:45 -0800 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: 8B06877129 X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [1.84 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_REPLYTO(0.00)[mckusick@mckusick.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.70)[0.705,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[mckusick.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.25)[0.246,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: chez.mckusick.com]; NEURAL_SPAM_LONG(0.34)[0.339,0]; RCVD_IN_DNSWL_NONE(0.00)[235.157.36.70.list.dnswl.org : 127.0.10.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:46375, ipnet:70.36.128.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-0.34)[ip: (-0.58), ipnet: 70.36.128.0/19(-0.29), asn: 46375(-0.74), country: US(-0.08)] X-Mailman-Approved-At: Fri, 21 Dec 2018 01:24:20 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 01:20:15 -0000 Thanks Rebecca for the report and Mark for the analysis of the problem. This should be fixed in -r342290. Kirk McKusick =-=-= From: Kirk McKusick Date: Fri, 21 Dec 2018 01:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342290 - head/sys/kern Author: mckusick Date: Fri Dec 21 01:09:25 2018 New Revision: 342290 URL: https://svnweb.freebsd.org/changeset/base/342290 Log: Some filesystems (like cd9660 and ext3) require that VFS_STATFS() be called before VFS_ROOT() is called. Move the call for VFS_STATFS() so that it is done after VFS_MOUNT(), but before VFS_ROOT(). This change actually improves the robustness of the mount system call because it returns an error rather than failing silently when VFS_STATFS() returns failure. Reported by: Rebecca Cran Sponsored by: Netflix Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Dec 20 22:39:58 2018 (r342289) +++ head/sys/kern/vfs_mount.c Fri Dec 21 01:09:25 2018 (r342290) @@ -895,6 +895,7 @@ vfs_domount_first( */ error1 = 0; if ((error = VFS_MOUNT(mp)) != 0 || + (error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { if (error1 != 0) { error = error1; @@ -916,7 +917,6 @@ vfs_domount_first( vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; *optlist = NULL; - (void)VFS_STATFS(mp, &mp->mnt_stat); /* * Prevent external consumers of mount options from reading mnt_optnew.