aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/namei.c')
-rw-r--r--fs/ext2/namei.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 080419814bae..dffb86536285 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -195,9 +195,6 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,
195 struct inode *inode = old_dentry->d_inode; 195 struct inode *inode = old_dentry->d_inode;
196 int err; 196 int err;
197 197
198 if (inode->i_nlink >= EXT2_LINK_MAX)
199 return -EMLINK;
200
201 dquot_initialize(dir); 198 dquot_initialize(dir);
202 199
203 inode->i_ctime = CURRENT_TIME_SEC; 200 inode->i_ctime = CURRENT_TIME_SEC;
@@ -217,10 +214,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,
217static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) 214static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
218{ 215{
219 struct inode * inode; 216 struct inode * inode;
220 int err = -EMLINK; 217 int err;
221
222 if (dir->i_nlink >= EXT2_LINK_MAX)
223 goto out;
224 218
225 dquot_initialize(dir); 219 dquot_initialize(dir);
226 220
@@ -346,11 +340,6 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
346 drop_nlink(new_inode); 340 drop_nlink(new_inode);
347 inode_dec_link_count(new_inode); 341 inode_dec_link_count(new_inode);
348 } else { 342 } else {
349 if (dir_de) {
350 err = -EMLINK;
351 if (new_dir->i_nlink >= EXT2_LINK_MAX)
352 goto out_dir;
353 }
354 err = ext2_add_link(new_dentry, old_inode); 343 err = ext2_add_link(new_dentry, old_inode);
355 if (err) 344 if (err)
356 goto out_dir; 345 goto out_dir;