From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D620CC678D4 for ; Mon, 6 Mar 2023 13:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbjCFNfV (ORCPT ); Mon, 6 Mar 2023 08:35:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbjCFNfR (ORCPT ); Mon, 6 Mar 2023 08:35:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F037D279AE for ; Mon, 6 Mar 2023 05:35:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7DF2B80E44 for ; Mon, 6 Mar 2023 13:35:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C65D5C4339B; Mon, 6 Mar 2023 13:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678109706; bh=PFvcFkjyiWx16iNC8MI17s0SXMFtvJTTHWtM38EqWIk=; h=Subject:To:Cc:From:Date:From; b=xgfq9Z0S/cgZzCX2E73LnnrYUDcrv7te7zGBsBVXAqK2yuANtKKIs8adSlp59wFk+ iT/efrh5nt68xjZffPSaswkmraYTvIYqjGWJWbmzelJo13tijpsz+Kag71yLvZNFVi H4j340RTHtXDsKQ19ZjTz5BUJWctuCoEf/4ij8Ww= Subject: FAILED: patch "[PATCH] f2fs: fix cgroup writeback accounting with fs-layer" failed to apply to 4.19-stable tree To: ebiggers@google.com, chao@kernel.org, jaegeuk@kernel.org, tj@kernel.org, willy@infradead.org Cc: From: Date: Mon, 06 Mar 2023 14:35:03 +0100 Message-ID: <1678109703254217@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y git checkout FETCH_HEAD git cherry-pick -x 844545c51a5b2a524b22a2fe9d0b353b827d24b4 # git commit -s git send-email --to '' --in-reply-to '1678109703254217@kroah.com' --subject-prefix 'PATCH 4.19.y' HEAD^.. Possible dependencies: 844545c51a5b ("f2fs: fix cgroup writeback accounting with fs-layer encryption") 9637d517347e ("Merge tag 'for-linus-20190715' of git://git.kernel.dk/linux-block") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 844545c51a5b2a524b22a2fe9d0b353b827d24b4 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 2 Feb 2023 17:02:39 -0800 Subject: [PATCH] f2fs: fix cgroup writeback accounting with fs-layer encryption When writing a page from an encrypted file that is using filesystem-layer encryption (not inline encryption), f2fs encrypts the pagecache page into a bounce page, then writes the bounce page. It also passes the bounce page to wbc_account_cgroup_owner(). That's incorrect, because the bounce page is a newly allocated temporary page that doesn't have the memory cgroup of the original pagecache page. This makes wbc_account_cgroup_owner() not account the I/O to the owner of the pagecache page as it should. Fix this by always passing the pagecache page to wbc_account_cgroup_owner(). Fixes: 578c647879f7 ("f2fs: implement cgroup writeback support") Cc: stable@vger.kernel.org Reported-by: Matthew Wilcox (Oracle) Signed-off-by: Eric Biggers Acked-by: Tejun Heo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 754841bce389..8a636500db0e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -739,7 +739,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) } if (fio->io_wbc && !is_read_io(fio->op)) - wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE); + wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE); inc_page_count(fio->sbi, is_read_io(fio->op) ? __read_io_type(page) : WB_DATA_TYPE(fio->page)); @@ -949,7 +949,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio) } if (fio->io_wbc) - wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE); + wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE); inc_page_count(fio->sbi, WB_DATA_TYPE(page)); @@ -1023,7 +1023,7 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) } if (fio->io_wbc) - wbc_account_cgroup_owner(fio->io_wbc, bio_page, PAGE_SIZE); + wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE); io->last_block_in_bio = fio->new_blkaddr;