Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2012 09:39:40 +0100
From:      Polytropon <freebsd@edvax.de>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Cc:        Bernt Hansson <bah@bananmonarki.se>
Subject:   Re: disk problem(s)
Message-ID:  <20120114093940.af177d39.freebsd@edvax.de>
In-Reply-To: <20120114092236.0c139ccd.freebsd@edvax.de>
References:  <4F113290.1060706@bananmonarki.se> <20120114092236.0c139ccd.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jan 2012 09:22:36 +0100, Polytropon wrote:
> The mkdir() function can be found (for UFS2) in the
> file /usr/src/sys/gnu/fs/ext2fs/ext2_vnops.c at
> line 1111 (sources of 8.2-STABLE i386 here). If
> you examine what mkdir() does, you'll see that
> the "too many links" is true when LINK_MAX is
> exceeded. Per /usr/src/sys/gnu/fs/ext2fs/ext2_fs.h
> we can determine that
> 
> 	#define EXT2_LINK_MAX           32000
> 
> is defined. Can you check if 32000 is the amount
> of directories created?

Shit, what have I done... of course the files
mentioned here do correspond to ext2 (Linux stuff),
and _not_ to UFS2.

The answer is in /usr/src/sys/sys/syslimits.h where
we find the following definition:

	#define LINK_MAX 32767 /* max file link count */

Can you check _that_ number against the amount of
directories created?

By the way, in cases like this it's helpful if you
provide the _command_ that you tried and the current
directory from _where_ you've tried it.

Also see /usr/src/sys/ufs/ufs/ufs_vnops.c, lines 1748
and onward, to see the UFS mkdir() system call acting
with

	if ((nlink_t)dp->i_nlink >= LINK_MAX) {
		error = EMLINK;
		goto out;
	}

when the LINK_MAX limit is reached.



Sorry for the confusion.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120114093940.af177d39.freebsd>