Is there a restriction of hardlinks for one documents?

Exists a restriction of variety of hardlinks for one documents? Is it defined anywhere? What are secure restrictions for Linux? And also what for various other POSIX systems?

2019-05-13 03:37:08
Source Share
Answers: 3

Looking at the ext3 inode framework disk layout in the linux bit resources (* include/linux/ext3 _ fs.h *) that details the web links count as being a 16 little bit number

struct ext3_inode {
    ... snip ...
    __le16  i_links_count;  /* Links count */


I presume that suggests that an ext3 filesystem can have up to 65535links.

I have not examined the values for various other filesystems.

2019-05-17 16:44:10

Posix calls for that the os recognize the principle of tough web links yet not that tough web links can in fact be made use of in any kind of certain condition. You can figure out the amount of tough web links are allowed at a certain area (this can differ by filesystem type) by calling pathconf(filename, _PC_LINK_MAX). The minimum limit (_POSIX_LINK_MAX) is 8, yet this is instead useless as link() can report several various other mistakes anyhow (approval refuted, disk complete, ).

The stat framework shops the link matter in an area of type nlink_t, so the sort of this area offers a ceiling on your system. Yet there is a great chance you'll never ever have the ability to get to that much : it prevails to have a 32 - little bit nlink_t yet just 16 little bits in several filesystems (a fast grep in the Linux resource reveals that ext [234 ], NTFS, UFS and also XFS make use of 16 - little bit link counts in the bit information frameworks).

2019-05-17 16:25:35

This is documents system reliant.

ext2/ 3/4 restriction is 65k web links

ext4 source line 643, struct ext4_inode - > __le16 i_links_count

2019-05-17 14:47:28