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 A0EEEC43387 for ; Mon, 7 Jan 2019 08:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 717412089F for ; Mon, 7 Jan 2019 08:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546850443; bh=BDby1gp0/fzZPxoIQbq1VBIRVigi/qhpqzplc1RMO3Y=; h=Subject:To:Cc:From:Date:List-ID:From; b=UZ5q53asOa3Luii/uy6sJtbJ1y8E94b7vzL2NB2Km+/0ODNFa7Hya5I30ue5mm+IO DtC6Aj87dlEhkig09PZEI7dKb4pqfQ3f/KY0hSy7hngVj1JqncSfbGZtlstbnloybm hbgYeVA8nXp7DhmQhA35fwopysATkASIsa87LYno= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726531AbfAGIkm (ORCPT ); Mon, 7 Jan 2019 03:40:42 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:34523 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfAGIkm (ORCPT ); Mon, 7 Jan 2019 03:40:42 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 9F2F21456; Mon, 7 Jan 2019 03:40:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 03:40:41 -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=uW60hI Ho2QKvRfys9BMCpt/wab+w9daQ0eHbsTtGBk8=; b=OzxkkmGL4m3zi1dwqCRxqs guZirS7U45i7kolC4PpXFiCdr02d8JOwwu4RMS2P0t4z8t8QBqCpzEiRCwZjbUX6 3XRcU46say4ZZs19xUtETAfIwiD9VopeJig2hJAj55iFI7aESakCJHX360FwAGjY trHGLTFeZhxxeu032lt4kGuEZm7pNgNeM3K9ddpGJQ24gusmHOsdqr6CMtIQGTac lpbAjETVsc80Td24NFCRwPmlap9GmVKB0jTGpEroxPclpJzFt7VdQ4uS7IXfpiDL FFTYB2wTrxsoRBZHhixKjDCCv7494k71wOCIHqcHE2NMnFmkBEmLRat7w6u78MdA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdeigdduvdehucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt 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 09B93E4664; Mon, 7 Jan 2019 03:40:39 -0500 (EST) Subject: FAILED: patch "[PATCH] f2fs: read page index before freeing" failed to apply to 4.14-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:38 +0100 Message-ID: <154685043890187@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.14-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);