From: Aneesh Kumar K.V Date: Sat, 29 Aug 2009 01:43:15 +0000 (-0400) Subject: ext4: Allow rename to create more than EXT4_LINK_MAX subdirectories X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2c94eb86c66e1eaaa1e7d8a2120f4fad5e7e7736;p=openwrt%2Fstaging%2Fblogic.git ext4: Allow rename to create more than EXT4_LINK_MAX subdirectories Use EXT4_DIR_LINK_MAX so that rename() can move a directory into new parent directory without running into the EXT4_LINK_MAX limit. Signed-off-by: Aneesh Kumar K.V Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index fea14dbd3c22..ba91bd0f7916 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2421,7 +2421,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, goto end_rename; retval = -EMLINK; if (!new_inode && new_dir != old_dir && - new_dir->i_nlink >= EXT4_LINK_MAX) + EXT4_DIR_LINK_MAX(new_dir)) goto end_rename; } if (!new_bh) {