From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 16 05:41:29 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A231065672 for ; Mon, 16 Aug 2010 05:41:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 098F78FC19 for ; Mon, 16 Aug 2010 05:41:28 +0000 (UTC) Received: by bwz20 with SMTP id 20so1868544bwz.13 for ; Sun, 15 Aug 2010 22:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=LHDtBUdqyrjQ22gA3MOB2GRANz2KTPrZKDejSjoePYA=; b=oqc62wXpOZqIrx9qJSL+/q8p8PPqnOWL5hN7Ux4OnLYLDFoP7ibunFwelMgJeK7hlq w848on34KQSkuNIwbqjzFxwyEEsFa7O+Vg5kWzgHBeMv07smriLQj068vNsEzO6Qya+c fwhOQWC+YgRd8aP7DlAJF5++44shWFd4kta78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=AdBGq00/hOVOAgAxkYOLijhOMC3GbF8nAgweB8p+KkQDw9koqWKLqksov8jonoE3dI NoBF89Ltz95HsYDhgAuTDByQU7D/B973NMlplWgDjHo8X1DXq0Z+lwSt31VZpyAObXaC pNticHcWAnfv7N6ZUX0dSPO+IXsgE5vaMgloc= MIME-Version: 1.0 Received: by 10.204.82.206 with SMTP id c14mr3003786bkl.145.1281937283067; Sun, 15 Aug 2010 22:41:23 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.204.82.6 with HTTP; Sun, 15 Aug 2010 22:41:23 -0700 (PDT) Date: Sun, 15 Aug 2010 22:41:23 -0700 X-Google-Sender-Auth: wi30znSYCy-We1UtUd9bfSf3mBU Message-ID: From: Garrett Cooper To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: mount(2) not returning EINVAL with invalid filesystems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2010 05:41:29 -0000 mount(2) says it should fail with EINVAL if the magic block is wrong: [EINVAL] The super block for the file system had a bad magic number or an out of range block size. This doesn't appear to be the case with a nmount layer though :/. I didn't find anything conclusive that noted where the issue was occurring, but I was wondering if anyone knew where it might be happening? $ sudo mount_msdosfs /dev/ada0s1b /mnt/ # ... madvise(0x800c09000,0x1000,0x5,0x8,0x3008,0x5039d0) = 0 (0x0) nmount(0x800c0d100,0x10,0x0,0x4,0xf0,0x5039d0) ERR#1 'Operation not permitted' write(2,"mount_msdosfs: ",15) ERR#9 'Bad file descriptor' write(2,": ",2) ERR#9 'Bad file descriptor' # ... mount_msdosfs: /dev/ada0s1b: Operation not permitted $ sudo mount /dev/ada0s1b /mnt/ # ... madvise(0x800c0b000,0x1000,0x5,0xa,0x2008,0x505dd8) = 0 (0x0) nmount(0x800c0d080,0x8,0x0,0x7fffffffdff0,0x70,0x505dd8) ERR#1 'Operation not permitted' write(2,"mount: ",7) ERR#9 'Bad file descriptor' write(2,": ",2) ERR#9 'Bad file descriptor' # ... mount: /dev/ada0s1b : Operation not permitted This is something small that I've noticed for a while now that doesn't make sense from a requirements perspective with the manpage. Thanks! -Garrett