disk problem(s)

Polytropon freebsd at edvax.de
Sat Jan 14 08:39:42 UTC 2012


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, ...


More information about the freebsd-questions mailing list