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 71CC0C43387 for ; Mon, 7 Jan 2019 08:40:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4204A2087F for ; Mon, 7 Jan 2019 08:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546850450; bh=Kev6BD+uXj5QqixR6qeZLmk2kaXS4tsfeNdZC49SY2Y=; h=Subject:To:Cc:From:Date:List-ID:From; b=UZBgg2GMf4zQJyRDcaTv3VyR7BpcG6C9E2OunALaT79t2btRgvFGj0bt7b0slNeWx 0DH6zd1xk8v6DBiKxx2EmPtPiUCZTtS3AmEE8T7KLg9yY3tNgCO38femGWEjiRsbxJ XYKEhX6v6xfzDMHRcifgknDNgjj02ycE17IoxEhc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfAGIkt (ORCPT ); Mon, 7 Jan 2019 03:40:49 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:47377 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfAGIkt (ORCPT ); Mon, 7 Jan 2019 03:40:49 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 84A3C859; Mon, 7 Jan 2019 03:40:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 03:40:48 -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=jKuSs5 fTnWWR3zGMXesMCzlGERwOLmOoxTGTfJoN2f4=; b=bo/97vgI7CQBTsz8P0zAum 2+kay5wwxHl8nUTFmrZXUcc793LdDR0/CQav+8HzLTezKSSG5fzRAhd7Gf1hVJQD gt+NKf9T/8x04UU9bEFuNOJ6zCcDErMGR+SyrXjGLAlGmk5pwUd9bIDA6i6oa2s2 MkEdqZny6eE8T+fzJ+RkCKjUoMZ6nPw3Ku7qG0poVaZ5ZBlhCPQuA75A1szWMVbt ijNObvk4kxzId3pg5ceKuhh7RjK1zwftwxU8Kg9v0uXluyGSV2xctSJu/o4V7TIx 00HCeyiGLUS279C12In12pr60nZYxuenQJvvnbp6u/27sf1ZTWjKMz9WPK8eujGg == 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 9B3B410085; Mon, 7 Jan 2019 03:40:47 -0500 (EST) Subject: FAILED: patch "[PATCH] f2fs: read page index before freeing" failed to apply to 4.4-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:46 +0100 Message-ID: <154685044656192@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.4-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);