Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b05ab1dc authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: Limit number of links that can be created by ext4_link()



In ext4_link we need to check using EXT4_LINK_MAX, and not
EXT4_DIR_LINK_MAX(), since ext4_link() is creating hard links of
regular files, and not directories.

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 2c94eb86
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2318,7 +2318,7 @@ static int ext4_link(struct dentry *old_dentry,
	struct inode *inode = old_dentry->d_inode;
	struct inode *inode = old_dentry->d_inode;
	int err, retries = 0;
	int err, retries = 0;


	if (EXT4_DIR_LINK_MAX(inode))
	if (inode->i_nlink >= EXT4_LINK_MAX)
		return -EMLINK;
		return -EMLINK;


	/*
	/*