From owner-freebsd-fs@FreeBSD.ORG Wed Mar 10 17:44:18 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A68910656E0 for ; Wed, 10 Mar 2010 17:44:18 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED8A8FC1F for ; Wed, 10 Mar 2010 17:44:17 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C0BBC45EE5; Wed, 10 Mar 2010 18:44:15 +0100 (CET) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 9454D45E8E; Wed, 10 Mar 2010 18:44:11 +0100 (CET) Date: Wed, 10 Mar 2010 18:44:11 +0100 From: Pawel Jakub Dawidek To: Michiel Detailleur Message-ID: <20100310174411.GE1715@garage.freebsd.pl> References: <4B97A963.9040300@scoutsengidsenvlaanderen.be> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qz2CZ664xQdCRdPu" Content-Disposition: inline In-Reply-To: <4B97A963.9040300@scoutsengidsenvlaanderen.be> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-fs@freebsd.org Subject: Re: ZFS snapshot name length limit? (File name too long) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2010 17:44:18 -0000 --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 10, 2010 at 03:14:59PM +0100, Michiel Detailleur wrote: > Hi, >=20 > I'm using sysutils/zfs-snapshot-mgmt for automatic creation and purging= =20 > of ZFS snapshots. It creates snapshot names like this (zfsfilesys is not= =20 > the actual name of the zfs filesystem, it's actually a bit longer. Why=20 > is this important? See below.): >=20 > zfsfilesys@auto-2010-03-10_06.00 >=20 > Clean and simple naming scheme you would think, but when I ls -la=20 > zfsfilesys/.zfs/snapshot, I get output from ls: >=20 > ls: auto-2010-03-10_06.00: File name too long >=20 > This happens for all snapshots with names longer than 16 characters for= =20 > this particular zfs file system. >=20 > Snapshots shorter than 16 characters are listed. >=20 > drwxr-xr-x 12 root wheel 23 Dec 24 14:06 2010-02-02-00/ >=20 > The name of the actual file system is 56 characters, starting from 'tank/' > For file systems with shorters names, longer snapshot names *are*=20 > accessible. >=20 > This seems to imply a maximum length of 72 characters (snapshot '@' sign= =20 > excluded) for *usable* snapshots? (usable in the sense that we can=20 > mount/look into them) >=20 > What limit am I (we?) hitting here? Is this a problem with ZFS itself or= =20 > with FreeBSD? Sure looks like a silly limit for the filesystem that=20 > touts 'biggest everything'. >=20 > I'm using FreeBSD 8.0, the zpool was freshly created on the 8.0 OS (not= =20 > upgraded from older FreeBSD ZFS version). >=20 > Thanks for any insight on this problem. =46rom looking at the code, I think you hitting this limit: /* * Be ultra-paranoid about making sure the type and fspath * variables will fit in our mp buffers, including the * terminating NUL. */ if (strlen(fstype) >=3D MFSNAMELEN || strlen(fspath) >=3D MNAMELEN) return (ENAMETOOLONG); in vfs_domount() or vfs_donmount(). This is FreeBSD limit caused by statfs structure: /* * filesystem statistics */ [...] #define MNAMELEN 88 /* size of on/from name bufs */ [...] struct statfs { [...] char f_mntfromname[MNAMELEN];/* mounted filesystem */ char f_mntonname[MNAMELEN]; /* directory on which mounted */ }; When you list .zfs/snapshot/ directory (especially with -l option) ZFS mounts snapshots on lookup and this is this mount that fails. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Qz2CZ664xQdCRdPu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkuX2msACgkQForvXbEpPzRZLwCgx7sMATavSxG6XkQz81tlAi/b JekAoLYNXmhmqQEq0TUTwu+cbw7hiMO4 =YbzN -----END PGP SIGNATURE----- --Qz2CZ664xQdCRdPu--