Skip to contentSkip to conversation

ext4: Allow rename even if link count is greater than EXT4_LINK_MAX for index directories

PATCH In review Aneesh Kumar K.V 2 participants 2 messages Aug 26, 2009 – Aug 29, 2009 ext4 file system

lore
Share & tools
lore
#0 lore raw

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.

---
 fs/ext4/namei.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/namei.c +1 -1
index de04013..9d0db97 100644
@@ -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
maintainer
#1 lore raw
Quoted 3 lines · Aneesh Kumar K.V

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.

Thanks, added to the ext4 patch queue.

- Ted