From: Chao Yu Subject: Re: [PATCH] f2fs: Add a segment type check in inplace write Date: Wed, 28 Mar 2018 09:59:08 +0800 Message-ID: References: <1522056743-7126-1-git-send-email-heyunlei@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1f10N8-0003zL-IF for linux-f2fs-devel@lists.sourceforge.net; Wed, 28 Mar 2018 01:59:30 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1f10N6-00AjSE-5X for linux-f2fs-devel@lists.sourceforge.net; Wed, 28 Mar 2018 01:59:30 +0000 In-Reply-To: <1522056743-7126-1-git-send-email-heyunlei@huawei.com> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Yunlei He , jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net On 2018/3/26 17:32, Yunlei He wrote: > This patch add a segment type check in IPU, in > case of something wrong with blkadd in dnode. > > Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, > --- > fs/f2fs/segment.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index f61c77b..c55942c 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -2790,10 +2790,15 @@ void write_data_page(struct dnode_of_data *dn, struct f2fs_io_info *fio) > int rewrite_data_page(struct f2fs_io_info *fio) > { > int err; > + struct f2fs_sb_info *sbi = fio->sbi; > > fio->new_blkaddr = fio->old_blkaddr; > /* i/o temperature is needed for passing down write hints */ > __get_segment_type(fio); > + > + f2fs_bug_on(sbi, !IS_DATASEG(get_seg_entry(sbi, > + GET_SEGNO(sbi, fio->new_blkaddr))->type)); > + > stat_inc_inplace_blocks(fio->sbi); > > err = f2fs_submit_page_bio(fio); > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot