Date: Wed, 10 Mar 2010 18:44:11 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Michiel Detailleur <md@scoutsengidsenvlaanderen.be> Cc: freebsd-fs@freebsd.org Subject: Re: ZFS snapshot name length limit? (File name too long) Message-ID: <20100310174411.GE1715@garage.freebsd.pl> In-Reply-To: <4B97A963.9040300@scoutsengidsenvlaanderen.be> References: <4B97A963.9040300@scoutsengidsenvlaanderen.be>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, Mar 10, 2010 at 03:14:59PM +0100, Michiel Detailleur wrote:
> Hi,
>
> I'm using sysutils/zfs-snapshot-mgmt for automatic creation and purging
> of ZFS snapshots. It creates snapshot names like this (zfsfilesys is not
> the actual name of the zfs filesystem, it's actually a bit longer. Why
> is this important? See below.):
>
> zfsfilesys@auto-2010-03-10_06.00
>
> Clean and simple naming scheme you would think, but when I ls -la
> zfsfilesys/.zfs/snapshot, I get output from ls:
>
> ls: auto-2010-03-10_06.00: File name too long
>
> This happens for all snapshots with names longer than 16 characters for
> this particular zfs file system.
>
> Snapshots shorter than 16 characters are listed.
>
> drwxr-xr-x 12 root wheel 23 Dec 24 14:06 2010-02-02-00/
>
> The name of the actual file system is 56 characters, starting from 'tank/'
> For file systems with shorters names, longer snapshot names *are*
> accessible.
>
> This seems to imply a maximum length of 72 characters (snapshot '@' sign
> excluded) for *usable* snapshots? (usable in the sense that we can
> mount/look into them)
>
> What limit am I (we?) hitting here? Is this a problem with ZFS itself or
> with FreeBSD? Sure looks like a silly limit for the filesystem that
> touts 'biggest everything'.
>
> I'm using FreeBSD 8.0, the zpool was freshly created on the 8.0 OS (not
> upgraded from older FreeBSD ZFS version).
>
> Thanks for any insight on this problem.
From 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) >= MFSNAMELEN || strlen(fspath) >= 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.
--
Pawel Jakub Dawidek http://www.wheelsystems.com
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)
iEYEARECAAYFAkuX2msACgkQForvXbEpPzRZLwCgx7sMATavSxG6XkQz81tlAi/b
JekAoLYNXmhmqQEq0TUTwu+cbw7hiMO4
=YbzN
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100310174411.GE1715>
