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] f2fs: avoid stale fi->gdirty_list pointer
Date: Mon, 16 Oct 2017 16:06:26 -0700 [thread overview]
Message-ID: <20171016230626.GB94030@jaegeuk-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <7a1ee4f5-78c3-fcb8-c4ef-97c7d49e5a07@huawei.com>
On 10/16, Chao Yu wrote:
> On 2017/10/13 10:14, Jaegeuk Kim wrote:
> > When doing fault injection test, f2fs_evict_inode() didn't remove gdirty_list
> > which incurs a kernel panic due to wrong pointer access.
> >
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> Minor thing, how about reverting judgment condition for readability?
>
> if (is_set_ckpt_flags(sbi, CP_ERROR_FLAG))
> f2fs_inode_synced()
We don't need to expect such the errored corner case first. ;)
> else
> f2fs_bug_on()
>
> Thanks,
>
> > ---
> > fs/f2fs/inode.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> > index f6db9d533ca4..1ae5396c97d6 100644
> > --- a/fs/f2fs/inode.c
> > +++ b/fs/f2fs/inode.c
> > @@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)
> >
> > if (!is_set_ckpt_flags(sbi, CP_ERROR_FLAG))
> > f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE));
> > + else
> > + f2fs_inode_synced(inode);
> >
> > /* ino == 0, if f2fs_new_inode() was failed t*/
> > if (inode->i_ino)
> >
next prev parent reply other threads:[~2017-10-16 23:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 2:14 Jaegeuk Kim
2017-10-16 1:56 ` [f2fs-dev] " Chao Yu
2017-10-16 23:06 ` Jaegeuk Kim [this message]
2017-10-17 13:15 ` Chao Yu
2017-10-17 18:16 ` Jaegeuk Kim
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=20171016230626.GB94030@jaegeuk-macbookpro.roam.corp.google.com \
--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
all inboxes | Powered by JetHome®