vfs: check i_nlink limits in vfs_{mkdir,rename_dir,link}
New field of struct super_block - ->s_max_links. Maximal allowed value of ->i_nlink or 0; in the latter case all checks still need to be done in ->link/->mkdir/->rename instances. Note that this limit applies both to directoris and to non-directories. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -24,7 +24,6 @@ struct sysv_sb_info {
|
||||
char s_bytesex; /* bytesex (le/be/pdp) */
|
||||
char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
|
||||
/* if 0: they are disallowed (ENAMETOOLONG) */
|
||||
nlink_t s_link_max; /* max number of hard links to a file */
|
||||
unsigned int s_inodes_per_block; /* number of inodes per block */
|
||||
unsigned int s_inodes_per_block_1; /* inodes_per_block - 1 */
|
||||
unsigned int s_inodes_per_block_bits; /* log2(inodes_per_block) */
|
||||
|
||||
Reference in New Issue
Block a user