f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode
The parent directory's nlink will change, not the inode.
Signed-off-by Kinglong Mee <[email protected]>
--- fs/f2fs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/namei.c +2 -2
@@ -908,8 +908,8 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, old_nlink = old_dir_entry ?-1 :1 ; new_nlink = -old_nlink; err = -EMLINK ; -if ((old_nlink >0 && old_inode->i_nlink >=F2FS_LINK_MAX ) || - (new_nlink >0 && new_inode->i_nlink >=F2FS_LINK_MAX )) +if ((old_nlink >0 && old_dir->i_nlink >=F2FS_LINK_MAX ) || + (new_nlink >0 && new_dir->i_nlink >=F2FS_LINK_MAX )) goto out_new_dir; }
Signature · 6 lines
2.9.3 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Quoted 3 lines · Kinglong Mee
The parent directory's nlink will change, not the inode.
Signed-off-by Kinglong Mee <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
Quoted 10 lines
--- fs/f2fs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/f2fs/namei.c +0
-0
fs/f2fs/namei.c static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, · line 915
Quoted 10 lines
fs/f2fs/namei.c +2
-2@@ -908,8 +908,8 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, old_nlink = old_dir_entry ?-1 :1 ; new_nlink = -old_nlink; err = -EMLINK ; -if ((old_nlink >0 && old_inode->i_nlink >=F2FS_LINK_MAX ) || - (new_nlink >0 && new_inode->i_nlink >=F2FS_LINK_MAX )) +if ((old_nlink >0 && old_dir->i_nlink >=F2FS_LINK_MAX ) || + (new_nlink >0 && new_dir->i_nlink >=F2FS_LINK_MAX )) goto out_new_dir; }
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot