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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87155C43387 for ; Mon, 7 Jan 2019 08:40:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58C7C206B7 for ; Mon, 7 Jan 2019 08:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546850447; bh=6uLFHZ5pbHuImqnXSTiP3DBRMjv6sKLgu8kG7DzVbcw=; h=Subject:To:Cc:From:Date:List-ID:From; b=2BFephmDmg18LECFPSF8rCq3GLkEtfdNFoHrAVCjQHiRGGUvmPzLN+cEvF67uEWBJ QzUF7hf3X+ODJl6eg7c/eVwOwTpNgdK1ifSPEWPeGgg2oZWbkj2BQo0VRrXHehteJR RMm+aQ4JjiuJIHOr2fO8/ypkoMCFUikpxnemwZ54= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbfAGIkr (ORCPT ); Mon, 7 Jan 2019 03:40:47 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:52685 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfAGIkq (ORCPT ); Mon, 7 Jan 2019 03:40:46 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8F7651466; Mon, 7 Jan 2019 03:40:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 03:40:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=gey/Kg HXSNcKrn+A1jzY56Zi0EEHxETmyN+ZtVrjsA8=; b=IcfMG04RhPSYY/j1gnso+P vv5+6uaiNKP+dOHriNMyfSxKe2z03UkzxiXeYBIJ8JsFZvKmRrm4Bk9CPezWUsdB eULLQjRx1T1YUk696eF85K+TFaRjKK4HQmGk0HjoGdrJCbIKYsODskb2aLNNzl7c k93wuXf+lpVR16SUcKF08OAo66OAiiUy4Preb3JHR9T27TMoQu6ZIzXH4+HW2Cuu L6dwiBjLGtGxdG2XWm4n/JBUUfMGATGDM/32Ezpq+IWVnex9AWITMbqBwwzK0Ch6 Gkh+a6Zb9Au/FdkN7EoLlq1yS/DzZOZLjKkqNoM/ovxGCqjAyzPZupoTufqcxjmA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdeigdduvdehucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id A1280E453B; Mon, 7 Jan 2019 03:40:44 -0500 (EST) Subject: FAILED: patch "[PATCH] f2fs: read page index before freeing" failed to apply to 4.9-stable tree To: bianpan2016@163.com, jaegeuk@kernel.org, stable@vger.kernel.org, yuchao0@huawei.com Cc: From: Date: Mon, 07 Jan 2019 09:40:42 +0100 Message-ID: <154685044211695@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-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 . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0ea295dd853e0879a9a30ab61f923c26be35b902 Mon Sep 17 00:00:00 2001 From: Pan Bian Date: Thu, 22 Nov 2018 18:58:46 +0800 Subject: [PATCH] f2fs: read page index before freeing The function truncate_node frees the page with f2fs_put_page. However, the page index is read after that. So, the patch reads the index before freeing the page. Fixes: bf39c00a9a7f ("f2fs: drop obsolete node page when it is truncated") Cc: Signed-off-by: Pan Bian Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e60c7779e114..a2273340991f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -826,6 +826,7 @@ static int truncate_node(struct dnode_of_data *dn) struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode); struct node_info ni; int err; + pgoff_t index; err = f2fs_get_node_info(sbi, dn->nid, &ni); if (err) @@ -845,10 +846,11 @@ static int truncate_node(struct dnode_of_data *dn) clear_node_page_dirty(dn->node_page); set_sbi_flag(sbi, SBI_IS_DIRTY); + index = dn->node_page->index; f2fs_put_page(dn->node_page, 1); invalidate_mapping_pages(NODE_MAPPING(sbi), - dn->node_page->index, dn->node_page->index); + index, index); dn->node_page = NULL; trace_f2fs_truncate_node(dn->inode, dn->nid, ni.blk_addr);