From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965527AbdCJJix (ORCPT ); Fri, 10 Mar 2017 04:38:53 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3860 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S965213AbdCJJit (ORCPT ); Fri, 10 Mar 2017 04:38:49 -0500 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: restrict write IO alignment condition Date: Fri, 10 Mar 2017 17:38:04 +0800 Message-ID: <20170310093804.35928-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.8.2.295.g3f1c1d0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.58C2740C.0229,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: 70e1abdfc36d010e6730cc8ebf66adbc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) && + fio->new_blkaddr != fio->old_blkaddr && fio->new_blkaddr & F2FS_IO_SIZE_MASK(sbi)) { err = -EAGAIN; if (!is_read) -- 2.8.2.295.g3f1c1d0