summaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-08-30 03:08:08 +0200
committerTheodore Ts'o <tytso@mit.edu>2009-08-30 03:08:08 +0200
commitb05ab1dc3795e6f997fb0d34f38fce5012533c3e (patch)
tree4479566851d82df15b0a350a3f2c3baa9009b9d4 /fs/ext4/namei.c
parentext4: Allow rename to create more than EXT4_LINK_MAX subdirectories (diff)
downloadlinux-b05ab1dc3795e6f997fb0d34f38fce5012533c3e.tar.xz
linux-b05ab1dc3795e6f997fb0d34f38fce5012533c3e.zip
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: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-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 ba91bd0f7916..f27c8164c1fe 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2318,7 +2318,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;
/*