ext4: Allow rename even if link count is greater than EXT4_LINK_MAX for index directories
PATCH 1/1 ext4: Allow rename even if link count is greater than EXT4_LINK_MAX for index directories
With EXT4_FEATURE_RO_COMPAT_DIR_NLINK we enable more than EXT4_LINK_MAX sub directories. So we should not fail rename with too many links error if EXT4_FEATURE_RO_COMPAT_DIR_NLINK feature is set.
Signed-off-by Aneesh Kumar K.V <[email protected]>
--- fs/ext4/namei.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/namei.c +1 -1
@@ -2413,7 +2413,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) {
Signature · 1 line
1.6.4.1.196.g31f0b
Theodore Tso
maintainerQuoted 3 lines · Aneesh Kumar K.V
With
EXT4_FEATURE_RO_COMPAT_DIR_NLINKwe enable more thanEXT4_LINK_MAXsub directories. So we should not fail rename with too many links error ifEXT4_FEATURE_RO_COMPAT_DIR_NLINKfeature is set.
Thanks, added to the ext4 patch queue.
- Ted