The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page
Date: Wed, 8 Mar 2017 13:35:46 -0800	[thread overview]
Message-ID: <20170308213546.GB5483@jaegeuk.local> (raw)
In-Reply-To: <8fa2118d-1da0-29f6-a755-fd661333d05d@huawei.com>

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) {
> > 

  reply	other threads:[~2017-03-08 21:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 21:51 [PATCH 1/2] f2fs: don't need to invalidate wrong node page Jaegeuk Kim
2017-03-06 21:51 ` [PATCH 2/2] f2fs: don't overwrite node block by SSR Jaegeuk Kim
2017-03-08 12:30   ` [f2fs-dev] " Chao Yu
2017-03-08 21:39     ` Jaegeuk Kim
2017-03-09 12:07       ` Chao Yu
2017-03-08 12:17 ` [f2fs-dev] [PATCH 1/2] f2fs: don't need to invalidate wrong node page Chao Yu
2017-03-08 21:35   ` Jaegeuk Kim [this message]
2017-03-09 11:36     ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170308213546.GB5483@jaegeuk.local \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox