Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593759 > unrolled thread

[PATCH 1/2] f2fs: don't need to invalidate wrong node page

Started byJaegeuk Kim <jaegeuk@kernel.org>
First post2017-03-06 23:00 +0100
Last post2017-03-09 12:50 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] f2fs: don't need to invalidate wrong node page Jaegeuk Kim <jaegeuk@kernel.org> - 2017-03-06 23:00 +0100
    Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node  page Chao Yu <yuchao0@huawei.com> - 2017-03-08 13:20 +0100
      Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node  page Jaegeuk Kim <jaegeuk@kernel.org> - 2017-03-08 22:40 +0100
        Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node  page Chao Yu <yuchao0@huawei.com> - 2017-03-09 12:50 +0100

#1593759 — [PATCH 1/2] f2fs: don't need to invalidate wrong node page

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-03-06 23:00 +0100
Subject[PATCH 1/2] f2fs: don't need to invalidate wrong node page
Message-ID<ti8PD-5S2-11@gated-at.bofh.it>
If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page
during f2fs_evict_inode(), which doesn't need to do.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/inode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 24bb8213d974..ef8610bf950f 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)
 	stat_dec_inline_dir(inode);
 	stat_dec_inline_inode(inode);
 
-	invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino, inode->i_ino);
+	/* ino == 0, if f2fs_new_inode() was failed t*/
+	if (inode->i_ino)
+		invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
+							inode->i_ino);
 	if (xnid)
 		invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
 	if (inode->i_nlink) {
-- 
2.11.0

[toc] | [next] | [standalone]


#1595104 — Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page

FromChao Yu <yuchao0@huawei.com>
Date2017-03-08 13:20 +0100
SubjectRe: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page
Message-ID<tiIJs-6r7-15@gated-at.bofh.it>
In reply to#1593759
On 2017/3/7 5:51, Jaegeuk Kim wrote:
> If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page
> during f2fs_evict_inode(), which doesn't need to do.

Hmm...should not allow other using of inode->i_ino in following codes of
f2fs_evict_inode, right?

Thanks,

> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/inode.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index 24bb8213d974..ef8610bf950f 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)
>  	stat_dec_inline_dir(inode);
>  	stat_dec_inline_inode(inode);
>  
> -	invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino, inode->i_ino);
> +	/* ino == 0, if f2fs_new_inode() was failed t*/
> +	if (inode->i_ino)
> +		invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
> +							inode->i_ino);
>  	if (xnid)
>  		invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
>  	if (inode->i_nlink) {
> 

[toc] | [prev] | [next] | [standalone]


#1595540 — Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-03-08 22:40 +0100
SubjectRe: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page
Message-ID<tiRtn-3QL-9@gated-at.bofh.it>
In reply to#1595104
On 03/08, Chao Yu wrote:
> On 2017/3/7 5:51, Jaegeuk Kim wrote:
> > If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page
> > during f2fs_evict_inode(), which doesn't need to do.
> 
> Hmm...should not allow other using of inode->i_ino in following codes of
> f2fs_evict_inode, right?

Right.

> 
> Thanks,
> 
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >  fs/f2fs/inode.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> > index 24bb8213d974..ef8610bf950f 100644
> > --- a/fs/f2fs/inode.c
> > +++ b/fs/f2fs/inode.c
> > @@ -411,7 +411,10 @@ void f2fs_evict_inode(struct inode *inode)
> >  	stat_dec_inline_dir(inode);
> >  	stat_dec_inline_inode(inode);
> >  
> > -	invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino, inode->i_ino);
> > +	/* ino == 0, if f2fs_new_inode() was failed t*/
> > +	if (inode->i_ino)
> > +		invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
> > +							inode->i_ino);
> >  	if (xnid)
> >  		invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
> >  	if (inode->i_nlink) {
> > 

[toc] | [prev] | [next] | [standalone]


#1595955 — Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page

FromChao Yu <yuchao0@huawei.com>
Date2017-03-09 12:50 +0100
SubjectRe: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page
Message-ID<tj4JX-4BF-11@gated-at.bofh.it>
In reply to#1595540
On 2017/3/9 5:35, Jaegeuk Kim wrote:
> On 03/08, Chao Yu wrote:
>> On 2017/3/7 5:51, Jaegeuk Kim wrote:
>>> If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page
>>> during f2fs_evict_inode(), which doesn't need to do.
>>
>> Hmm...should not allow other using of inode->i_ino in following codes of
>> f2fs_evict_inode, right?
> 
> Right.

I mean those codes below invalidate_mapping_pages(NODE_MAPPING(sbi),,)
After having a look at them, I think it's OK without any change. :)

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web