Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp172904imd; Wed, 31 Oct 2018 16:47:20 -0700 (PDT) X-Google-Smtp-Source: AJdET5eEmdmnc64NuznxpwNW9esJ/HFVlguhvBVIg/+b6QIyCg0p+N+skBKYsjqyVDtD13jgCW0N X-Received: by 2002:a63:3204:: with SMTP id y4mr5003817pgy.41.1541029640499; Wed, 31 Oct 2018 16:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029640; cv=none; d=google.com; s=arc-20160816; b=vwV6WJ+ALOf3Pw2mHAT5duv1syfm7Gywn33SfCEwI0DTYlE4T+w+TieBgN6Syked8j hlnj5XvyOB6fbiuj4urcak9Q6g85f65urJUaUkc0eaiTsusL3tTJaOfBATi2A8+IhNX0 xH2mrhx8xf4jlfME0CNP4DgFQvb/YOBLz8Q2l4MyZ5umHdAyITUd2DWCHpNe5Tro6SU7 jscwNoroDaXpv53iZrhq5KSvtxiNWAtQottPkj+XAv/6ClRReOLVrk95gB4tvZnMaGXl owrK8/k2yctDAnTrEJOtBJtaGUBFRuuGyH2SiQ04FMbEn9DIHrm+C+TJIFXonAxV7FGd vvcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=QvP9EGHDda80w54IPQbbwYzSXLeCL8PMAhFraW9OTRM=; b=FD+avcPde56pl/CAREyrm7Fnj6hvEsskBVbCKGTS5aD7PNWKFWFF4+UeVXaUiFxue2 CuCB/apzmgOQCBoLsZEYXC9u025H01Wc0t7UfbO98ysIHiIOettZRqlPAxiXQqy3Op5X 2agq/8Z/Mc/h46YJl6cG9tVc6Vr3uceyVtqAF1XoCmo+pAHvll759bPJauRruLoj4Epr K/yE8ZC4U0UcbBGOdr6RyRa9xXzwbdFMbjMKxI94y8kxZALUjyZq4MlUylkIoCzAfpwh OdCTPnyLMOR05hiuHNAYYwW4FVfaP+Qc+8Kz8xLfsaGCI7XY6T/s9hkoKltB8IJJdIMb YYJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="11VP/W7/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6-v6si26608674plt.346.2018.10.31.16.47.05; Wed, 31 Oct 2018 16:47:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="11VP/W7/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728896AbeKAIrJ (ORCPT + 99 others); Thu, 1 Nov 2018 04:47:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728672AbeKAIHN (ORCPT ); Thu, 1 Nov 2018 04:07:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3391020838; Wed, 31 Oct 2018 23:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027222; bh=2hl5u622X1c+uqokhqZBotD8d8ug4sepP9SC4XCeiY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=11VP/W7/RCubYZIfgjBo6VunJAHGzhSvTqm97a1L2d9p87uSNBMotCZxKYECT4MJ5 e0B0veTk//F4pU+PzqqFX/MUsm9sCQHKWBB3SWrxvvZTdqxZDX3NZGomlQ3LRNeYs6 PqzyB8Y6CKIuNK1c++/244O2qmmqBbu3i1mzDVGA= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH AUTOSEL 4.19 088/146] f2fs: fix to account IO correctly for cgroup writeback Date: Wed, 31 Oct 2018 19:04:43 -0400 Message-Id: <20181031230541.28822-88-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu [ Upstream commit 78efac537de33faab9a4302cc05a70bb4a8b3b63 ] Now, we have supported cgroup writeback, it depends on correctly IO account of specified filesystem. But in commit d1b3e72d5490 ("f2fs: submit bio of in-place-update pages"), we split write paths from f2fs_submit_page_mbio() to two: - f2fs_submit_page_bio() for IPU path - f2fs_submit_page_bio() for OPU path But still we account write IO only in f2fs_submit_page_mbio(), result in incorrect IO account, fix it by adding missing IO account in IPU path. Fixes: d1b3e72d5490 ("f2fs: submit bio of in-place-update pages") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/data.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 382c1ef9a9e4..cd5d53353a61 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -456,6 +456,10 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) bio_put(bio); return -EFAULT; } + + if (fio->io_wbc && !is_read_io(fio->op)) + wbc_account_io(fio->io_wbc, page, PAGE_SIZE); + bio_set_op_attrs(bio, fio->op, fio->op_flags); __submit_bio(fio->sbi, bio, fio->type); -- 2.17.1