Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755405AbbBEIRE (ORCPT ); Thu, 5 Feb 2015 03:17:04 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:21495 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbbBEIRB (ORCPT ); Thu, 5 Feb 2015 03:17:01 -0500 X-AuditID: cbfee61a-f79c06d000004e71-f8-54d326fcd255 From: Chao Yu To: "'Jaegeuk Kim'" Cc: "'Changman Lee'" , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <008c01d03d35$62ceb7a0$286c26e0$@samsung.com> <20150202233734.GD34575@jaegeuk-mac02.mot.com> In-reply-to: <20150202233734.GD34575@jaegeuk-mac02.mot.com> Subject: RE: [PATCH 2/2] f2fs: don't discard next free dnode page for an umount checkpoint Date: Thu, 05 Feb 2015 16:16:04 +0800 Message-id: <005e01d0411c$1d2e07b0$578a1710$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQJ1VZbd+O0zmBXtWP47x4W6HYbkaAH8wUgnm4egdeA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsVy+t9jAd0/apdDDHpXi1lc29fIZPFk/Sxm i0uL3C0u75rD5sDisWlVJ5vH7gWfmTz6tqxi9Pi8SS6AJYrLJiU1J7MstUjfLoEr48jt84wF bwQreqbfYm1g7OLrYuTkkBAwkTj2agkLhC0mceHeerYuRi4OIYFFjBL3/iyBcn4wSrSdnsQG UsUmoCKxvOM/E4gtIqAm0btvCpDNwcEsUCSxaoUASFhIIEvi4d7XYGFOAWuJr9tLQcLCAjES C57sYwSxWQRUJWZ8ucoOYvMKWEp8mPGNFcIWlPgx+R7YPcwCWhLrdx5ngrDlJTavecsMcaeC xI6zrxkhLrCS2DH1KlSNuMTGI7dYJjAKzUIyahaSUbOQjJqFpGUBI8sqRtHUguSC4qT0XEO9 4sTc4tK8dL3k/NxNjOAIeCa1g3Flg8UhRgEORiUeXst9l0KEWBPLiitzDzFKcDArifBqclwO EeJNSaysSi3Kjy8qzUktPsQozcGiJM6rZN8WIiSQnliSmp2aWpBaBJNl4uCUamDctNJKSC+0 7rr11wajp2zOKVuNlTYWnrJa5ZC5W3/Ok59OB65euv2nwaTnwJM+vvVGvyKF9lkXc67fpRpf 7Hb5xPGgkL+b1kX8mztJ/PSfjzFWt66FsthKHw5omJWQ8PVNzk5tRctAo+mVXrP3lUXtXjFH uaZzlk9nRNW0h3k7XQXuq1bPvfVYiaU4I9FQi7moOBEADCE0YHwCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2465 Lines: 69 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Tuesday, February 03, 2015 7:38 AM > To: Chao Yu > Cc: Changman Lee; linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org > Subject: Re: [PATCH 2/2] f2fs: don't discard next free dnode page for an umount checkpoint > > Hi Chao, > > On Sat, Jan 31, 2015 at 05:06:59PM +0800, Chao Yu wrote: > > Previously, discard_next_dnode is added before a checkpoint to prevent that we > > may meet a garbage dnode page readed from next free blkaddr in recover flow. > > > > Since f2fs will skip recovery flow for a clean umount image, this condition will > > never happen. > > > > So it's safe for us to leave next free dnode as it is in an umount checkpoint. > > > > Signed-off-by: Chao Yu > > --- > > fs/f2fs/checkpoint.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c > > index f7cdcad..991fd0a 100644 > > --- a/fs/f2fs/checkpoint.c > > +++ b/fs/f2fs/checkpoint.c > > @@ -905,8 +905,12 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control > *cpc) > > /* > > * This avoids to conduct wrong roll-forward operations and uses > > * metapages, so should be called prior to sync_meta_pages below. > > + * But if we are in an umount checkpoint, we'd better skip this > > + * because we will not enter recovery flow to use the next free > > + * blkaddr when mounting it. > > */ > > - discard_next_dnode(sbi, NEXT_FREE_BLKADDR(sbi, curseg)); > > + if (cpc->reason != CP_UMOUNT) > > + discard_next_dnode(sbi, NEXT_FREE_BLKADDR(sbi, curseg)); > > The reason for discard_next_dnode is to avoid wrong execution due to old > mkfs.f2fs which remains gabage data. > It needs to do all the time. Maybe my previously understanding is wrong. Is this issue due to old mkfs.f2fs do not discard entire flash storage device when formating? Or another bug of mkfs? If so, can you please offer a fix commit id of mkfs? I'm curious about how this happened. :-) Thanks, > > Thanks, > > > > > /* Flush all the NAT/SIT pages */ > > while (get_pages(sbi, F2FS_DIRTY_META)) { > > -- > > 2.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/