From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbdCMM0A (ORCPT ); Mon, 13 Mar 2017 08:26:00 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3872 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750808AbdCMMZw (ORCPT ); Mon, 13 Mar 2017 08:25:52 -0400 Subject: Re: [PATCH] f2fs: restrict write IO alignment condition To: Jaegeuk Kim References: <20170310093804.35928-1-yuchao0@huawei.com> <20170310185005.GC22979@jaegeuk.local> CC: , , From: Chao Yu Message-ID: Date: Mon, 13 Mar 2017 20:25:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20170310185005.GC22979@jaegeuk.local> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.58C68FA2.003F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 46e1681e9979595bd7c61a0a72ec5fe0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/3/11 2:50, Jaegeuk Kim wrote: > On 03/10, Chao Yu wrote: >> We should only align start offset of bio with defined IO_SIZE for below >> conditions: >> a. write IOs >> b. Out-place-update >> c. non-meta page >> >> Signed-off-by: Chao Yu >> --- >> fs/f2fs/data.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index 1375fef11146..3e6b0cc5e36a 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -395,7 +395,9 @@ int f2fs_submit_page_mbio(struct f2fs_io_info *fio) >> __submit_merged_bio(io); >> alloc_new: >> if (io->bio == NULL) { >> - if ((fio->type == DATA || fio->type == NODE) && >> + if (!is_read && (fio->type == DATA || fio->type == NODE) && >> + bio_page->mapping != META_MAPPING(sbi) && > > BUG_ON(), since it's covered by fio->type == DATA || fio->type == NODE. Oh, the condition I added here is wrong, since move_encrypted_block will add a meta page into DATA type bio cache, also we can not add a BUG_ON here. > >> + fio->new_blkaddr != fio->old_blkaddr && > > BUG_ON(), since LFS mount option doesn't allow any in-place updates. You're right. :) > >> fio->new_blkaddr & F2FS_IO_SIZE_MASK(sbi)) { > > So, is_read is worth to check? Yes. I will fix them and resend v2. Thanks, > > Thanks, > >> err = -EAGAIN; >> if (!is_read) >> -- >> 2.8.2.295.g3f1c1d0 > > . >