From patchwork Wed Apr 5 18:02:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 9665371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 474C460364 for ; Wed, 5 Apr 2017 18:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40A5F27FAE for ; Wed, 5 Apr 2017 18:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AAF2285A7; Wed, 5 Apr 2017 18:03:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9B8528595 for ; Wed, 5 Apr 2017 18:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755949AbdDESCb (ORCPT ); Wed, 5 Apr 2017 14:02:31 -0400 Received: from mail.kernel.org ([198.145.29.136]:36708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755229AbdDESCF (ORCPT ); Wed, 5 Apr 2017 14:02:05 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACDC52014A; Wed, 5 Apr 2017 18:02:03 +0000 (UTC) Received: from localhost (107-1-141-74-ip-static.hfc.comcastbusiness.net [107.1.141.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95C2F20120; Wed, 5 Apr 2017 18:02:02 +0000 (UTC) From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 1/2] f2fs: count writeback pages correctly Date: Wed, 5 Apr 2017 11:02:00 -0700 Message-Id: <20170405180201.4021-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.11.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes # of outstanding writeback pages by checking its original page. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3d74c0ffa4c7..af3e849e96d2 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -94,7 +94,6 @@ static void f2fs_write_end_io(struct bio *bio) bio_for_each_segment_all(bvec, bio, i) { struct page *page = bvec->bv_page; - enum count_type type = WB_DATA_TYPE(page); if (IS_DUMMY_WRITTEN_PAGE(page)) { set_page_private(page, (unsigned long)NULL); @@ -113,7 +112,7 @@ static void f2fs_write_end_io(struct bio *bio) mapping_set_error(page->mapping, -EIO); f2fs_stop_checkpoint(sbi, true); } - dec_page_count(sbi, type); + dec_page_count(sbi, WB_DATA_TYPE(page)); clear_cold_data(page); end_page_writeback(page); } @@ -389,7 +388,7 @@ int f2fs_submit_page_mbio(struct f2fs_io_info *fio) fio->submitted = 1; if (!is_read) - inc_page_count(sbi, WB_DATA_TYPE(bio_page)); + inc_page_count(sbi, WB_DATA_TYPE(fio->page)); down_write(&io->io_rwsem); @@ -403,7 +402,7 @@ int f2fs_submit_page_mbio(struct f2fs_io_info *fio) fio->new_blkaddr & F2FS_IO_SIZE_MASK(sbi)) { err = -EAGAIN; if (!is_read) - dec_page_count(sbi, WB_DATA_TYPE(bio_page)); + dec_page_count(sbi, WB_DATA_TYPE(fio->page)); goto out_fail; } io->bio = __bio_alloc(sbi, fio->new_blkaddr,