From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 11 07:40:02 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E933F1065670 for ; Tue, 11 Oct 2011 07:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C5D2C8FC16 for ; Tue, 11 Oct 2011 07:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p9B7e1dm005259 for ; Tue, 11 Oct 2011 07:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p9B7e1s6005258; Tue, 11 Oct 2011 07:40:01 GMT (envelope-from gnats) Resent-Date: Tue, 11 Oct 2011 07:40:01 GMT Resent-Message-Id: <201110110740.p9B7e1s6005258@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4364106566B for ; Tue, 11 Oct 2011 07:36:10 +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 B3B018FC13 for ; Tue, 11 Oct 2011 07:36:10 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9B7aAxw083319 for ; Tue, 11 Oct 2011 07:36:10 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p9B7aAP4083318; Tue, 11 Oct 2011 07:36:10 GMT (envelope-from nobody) Message-Id: <201110110736.p9B7aAP4083318@red.freebsd.org> Date: Tue, 11 Oct 2011 07:36:10 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/161481: mount fails with ENAMETOOLONG with path shorter than 255 // 1023 characters X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 07:40:02 -0000 >Number: 161481 >Category: kern >Synopsis: mount fails with ENAMETOOLONG with path shorter than 255 // 1023 characters >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 11 07:40:01 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 10-CURRENT >Organization: n/a >Environment: FreeBSD fallout.local 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r226242M: Mon Oct 10 20:50:51 PDT 2011 gcooper@fallout.local:/usr/obj/usr/src/sys/FALLOUT amd64 >Description: mount(2) claims that it should fail with ENAMETOOLONG if the path is <= 255 or 1023 characters: [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or the entire length of a path name exceeded 1023 charac- ters. In practice, that isn't true: # mount -t nullfs -o noatime /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/ports/distfiles /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/_.w/usr/ports/distfiles mount_nullfs: File name too long # echo mount -t nullfs -o noatime /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/ports/distfiles/ /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/_.w/usr/ports/distfiles | awk '{ print length($(NF - 1)), length($NF) }' 83 90 # It's failing a bounds check in nmount and its callees. I've seen this issue with both nullfs and UFS, so it's most likely a problem in vfs_mount.c, etc. I've seen this issue on 8.2-RELEASE (FreeNAS), as well as 9-CURRENT and 10-CURRENT. >How-To-Repeat: #!/bin/sh set -e mkdir -p /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/_.w/usr/ports/distfiles/ md=$(mdconfig -a -t swap -s 512m) newfs /dev/$md mount /dev/$md /nfs/scratch/freenas-2/freenas/projects/freenas8-plugins/obj.amd64/_.w/usr/ports/distfiles/ >Fix: >Release-Note: >Audit-Trail: >Unformatted: