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 01491C43387 for ; Mon, 7 Jan 2019 08:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4B95206B7 for ; Mon, 7 Jan 2019 08:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546850454; bh=cT7pVQTWAxV9WL7LSY/P5K7lLscvhoXMV9pIkDL8+oU=; h=Subject:To:Cc:From:Date:List-ID:From; b=ZZcJe/1b7pWKnQZ3ErKgzV1JmB/btHT7p1n78GqqWvPs0/fThDGTjQPetoMcpayit dmGOcCNJ98RbQdUekoNPWBel9NInrMRjwzA+JqqliDC13tmh5zOglSXuRJhUsTjRTW NhB5AfPAk/98GHpSRwIPvzyL8SCERtfQjkJf29dA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbfAGIky (ORCPT ); Mon, 7 Jan 2019 03:40:54 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:56321 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfAGIky (ORCPT ); Mon, 7 Jan 2019 03:40:54 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 16FC51456; Mon, 7 Jan 2019 03:40:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 03:40:53 -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=xZ2vku +YWJOy6do13tmOEsUXbl7o6fERi8NPbMfgOkg=; b=PA5F6bhKxUNvJh60qsPFm5 3qFn8h/RPFkB0T0NMTuoFejrpNiLCIAfUAmaYO405ZxSI4sTQ7yZcY1rFCC99Ptt vG1g94W688rEGSyfLGnMUhA7fkov+UR7ZgKRTVy/uyJ4m3uSls+cx1mEdVFXPWT/ FYBTpqHzX1X3VL2c5KtbrHI1XMR1eOZfeXzJPRtiMAO8ntKdSrFvEbDjoF50dY4Y gP4fzs3z7HMuQOdb/KYTjjZmZ2VVwTUWFNm26I7zVR8rjVlfngpJY5ZX1MU40cWR ko2suAeFGgiFkp8GTLHry+5fLZDrCHdQhjfv/FQCb3aPizl2aUhwX5bAw/QTjj4g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdeigdduvdehucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedv 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 1361DE453B; Mon, 7 Jan 2019 03:40:51 -0500 (EST) Subject: FAILED: patch "[PATCH] f2fs: read page index before freeing" failed to apply to 3.18-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:50 +0100 Message-ID: <154685045075249@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 3.18-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);