From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937362AbdJQSQt (ORCPT ); Tue, 17 Oct 2017 14:16:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936802AbdJQSQr (ORCPT ); Tue, 17 Oct 2017 14:16:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4932D21871 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jaegeuk@kernel.org Date: Tue, 17 Oct 2017 11:16:43 -0700 From: Jaegeuk Kim To: Chao Yu Cc: Chao Yu , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: avoid stale fi->gdirty_list pointer Message-ID: <20171017181643.GA10794@jaegeuk-macbookpro.roam.corp.google.com> References: <20171013021411.25850-1-jaegeuk@kernel.org> <7a1ee4f5-78c3-fcb8-c4ef-97c7d49e5a07@huawei.com> <20171016230626.GB94030@jaegeuk-macbookpro.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17, Chao Yu wrote: > On 2017/10/17 7:06, Jaegeuk Kim wrote: > > 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 > >> > >> Reviewed-by: Chao Yu > >> > >> 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. ;) > > Alright, making compiler being aware of this by using {un,}likely? :) Yup, added. ;) > > Thanks, > > > > >> 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) > >>> > > > > ------------------------------------------------------------------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > _______________________________________________ > > Linux-f2fs-devel mailing list > > Linux-f2fs-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > >