From nobody@FreeBSD.org  Thu Jan  3 00:57:17 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id E72A68DE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Jan 2013 00:57:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id C3210D1E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Jan 2013 00:57:17 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r030vH45016661
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 3 Jan 2013 00:57:17 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r030vHMM016660;
	Thu, 3 Jan 2013 00:57:17 GMT
	(envelope-from nobody)
Message-Id: <201301030057.r030vHMM016660@red.freebsd.org>
Date: Thu, 3 Jan 2013 00:57:17 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Unknown mount filesystem error messages are confusing
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174918
>Category:       kern
>Synopsis:       [vfs] Unknown mount filesystem error messages are confusing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 03 01:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun Mar 10 05:02:10 UTC 2013
>Originator:     Garrett Cooper
>Release:        9.1-PRERELEASE
>Organization:
EMC Isilon
>Environment:
FreeBSD forza.west.isilon.com 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r+336aa21: Wed Dec 19 18:05:45 PST 2012     gcooper@forza.west.isilon.com:/usr/obj/usr/src/sys/FORZA  amd64
>Description:
Error messages printed out by mount(2) are unfortunately not helpful when
trying to determine whether or not an unsupported (or non-existent)
filesystem is invoked. Example:

$ sudo mount -t foobarfs foo $PWD
mount: foo: Operation not supported by device

The issue is with the following call in vfs_mount.c:

1079                 if (vfsp == NULL)
1080                         return (ENODEV);
1081                 if (jailed(td->td_ucred) && !(vfsp->vfc_flags & VFCF_JAIL))
1082                         return (EPERM);

and this call in vfs_init.c:

131         /* Try to load the respective module. */
132         *error = kern_kldload(td, fstype, &fileid);
133         if (*error)
134                 return (NULL);

It seems like the error should be either EINVAL or ENOENT, but doing the latter
in mount(2) would be bad form.
>How-To-Repeat:
mount -t foobarfs foo /
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
