aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-08-29 21:08:08 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-14 08:06:18 -0800
commite4670b394dd5cdfc5fda17e3ec94c444dcaecac2 (patch)
tree00a54762630cf498fc28acb9a8095c04bfd0d93c
parent929c7112197d58053117b3303f3bcf160bcdca45 (diff)
ext4: Limit number of links that can be created by ext4_link()
(cherry picked from commit b05ab1dc3795e6f997fb0d34f38fce5012533c3e) 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: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 9d51ab9dd9d..06ce2d88598 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2310,7 +2310,7 @@ static int ext4_link(struct dentry *old_dentry,
struct inode *inode = old_dentry->d_inode;
int err, retries = 0;
- if (EXT4_DIR_LINK_MAX(inode))
+ if (inode->i_nlink >= EXT4_LINK_MAX)
return -EMLINK;
/*