* [PATCH 1/2] f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode
[not found] <02f41895-ea36-df3c-1295-46fa960b20bd@gmail.com>
@ 2017-03-04 13:48 ` Kinglong Mee
2017-03-06 10:54 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2017-03-04 13:48 UTC (permalink / raw)
To: Jaegeuk Kim, linux-f2fs-devel, Chao Yu, Kinglong Mee
The parent directory's nlink will change, not the inode.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
fs/f2fs/namei.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 0eda022..3231a0a 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -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;
}
--
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode
2017-03-04 13:48 ` [PATCH 1/2] f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode Kinglong Mee
@ 2017-03-06 10:54 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-03-06 10:54 UTC (permalink / raw)
To: Kinglong Mee, Jaegeuk Kim, linux-f2fs-devel
On 2017/3/4 21:48, Kinglong Mee wrote:
> The parent directory's nlink will change, not the inode.
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
> ---
> fs/f2fs/namei.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index 0eda022..3231a0a 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-06 10:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <02f41895-ea36-df3c-1295-46fa960b20bd@gmail.com>
2017-03-04 13:48 ` [PATCH 1/2] f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode Kinglong Mee
2017-03-06 10:54 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.