2009-08-26 11:37:27

by Aneesh Kumar K.V

[permalink] [raw]
Subject: [PATCH] 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(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index de04013..9d0db97 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -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) {
--
1.6.4.1.196.g31f0b



2009-08-29 01:51:35

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: Allow rename even if link count is greater than EXT4_LINK_MAX for index directories

On Wed, Aug 26, 2009 at 05:07:25PM +0530, Aneesh Kumar K.V wrote:
> 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