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=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_NEOMUTT 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 3E004C282C8 for ; Mon, 28 Jan 2019 19:28:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 051652171F for ; Mon, 28 Jan 2019 19:28:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o/ssffrE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbfA1T2P (ORCPT ); Mon, 28 Jan 2019 14:28:15 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:52618 "EHLO mail-wm1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727330AbfA1T2P (ORCPT ); Mon, 28 Jan 2019 14:28:15 -0500 Received: by mail-wm1-f43.google.com with SMTP id m1so15277212wml.2 for ; Mon, 28 Jan 2019 11:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+QrpcMfKvmPToNEPEzJqCJcWZwLUMIJtqobRLbd1H4k=; b=o/ssffrEfntlXxZMMtEOsDfd6QONnVMqVGjNXy6DvgZDWbrnLYcETsWsDC9jdtFaTn BjEA9H+ye3F29Cp5Rn80PtVFoGBNOwNWT3q5Mved0SpQW0Jsyv2YfQT2ZzLAXLQNDhP5 6kSN/OGRtDSxglOImuS3C977RmGViAiZUGUgG2ShSb68DrdmFyAA5QqAKAyzU09WVg1H 7ctzr+ge9BSrweH+51YTrDGOnVBYJRWLYN7QDqUqjsIGifsqYL03wCbocM7Fz4mkpGxM +Rh2BgaIPZZbz+EGHEcAD5sMwFV0JazjVtS36NBfExAQWTSyAomDbvbNHZnq50ZanDhI iBsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+QrpcMfKvmPToNEPEzJqCJcWZwLUMIJtqobRLbd1H4k=; b=PU0hB4vmsq5C2ha8+8CtQo8dZolAGNRHO3ORUcC9gZuUUQ86LMjFQfxbRWHFddX1cV QfRkmFOGCZFY/CZkhVw/sRyHthmkaub4b/r99HWf5OSrWKzjrBGu+WtOUHXQExE98JYD hwODZKPJrtbv+aaK1hxANyjywm8BKcfM89QfbFLstbciJQ3KpPcUQI9QR36xtZFHqwef ycUKtQwCTXn6blN82NaYfaGYnR+hcM5zfnZDCYUDmqJfG5CnaZCiij0igJAiTwtUcIxF 9NuRF0/rCdjMSliTXzmmaQoBKdHWCBaG2gpJf5MU9leAFe3WZKNiSUZifz/0cG5HaDal JWHA== X-Gm-Message-State: AJcUukeOB+V4WQwhXweRM5lDi67k6UVtWPPfSudZxf6tNvK98nBOPmjZ BEMIYCv6rj69WjGwNLQvDE8xkt7f X-Google-Smtp-Source: AHgI3IZYhmVmnqGc5I6+IqbfFtstdfOzoTyP1AT6kj6TRJFNCOf4jiuUGs5/p3QYRBsU7yimH4lAOA== X-Received: by 2002:a1c:c1c9:: with SMTP id r192mr7336952wmf.146.1548703692564; Mon, 28 Jan 2019 11:28:12 -0800 (PST) Received: from debian (cpc101300-bagu16-2-0-cust362.1-3.cable.virginm.net. [86.21.41.107]) by smtp.gmail.com with ESMTPSA id a132sm509255wmh.5.2019.01.28.11.28.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 11:28:11 -0800 (PST) Date: Mon, 28 Jan 2019 19:28:09 +0000 From: Sudip Mukherjee To: gregkh@linuxfoundation.org Cc: bianpan2016@163.com, jaegeuk@kernel.org, stable@vger.kernel.org, yuchao0@huawei.com Subject: Re: FAILED: patch "[PATCH] f2fs: read page index before freeing" failed to apply to 4.14-stable tree Message-ID: <20190128192809.aq2vgt7kwfecv4li@debian> References: <154685043890187@kroah.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="in3frouciwuue7ko" Content-Disposition: inline In-Reply-To: <154685043890187@kroah.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --in3frouciwuue7ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Greg, On Mon, Jan 07, 2019 at 09:40:38AM +0100, gregkh@linuxfoundation.org wrote: > > 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 . The attached backported patch should apply to 4.14-stable tree. -- Regards Sudip --in3frouciwuue7ko Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-f2fs-read-page-index-before-freeing.patch" >From c9d00cc882753ae1c6b56f9b936eefe343dba4e2 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 commit 0ea295dd853e0879a9a30ab61f923c26be35b902 upstream 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 Signed-off-by: Sudip Mukherjee --- fs/f2fs/node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 65de72d65562..12060fbfbb05 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -694,6 +694,7 @@ static void truncate_node(struct dnode_of_data *dn) { struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode); struct node_info ni; + pgoff_t index; get_node_info(sbi, dn->nid, &ni); f2fs_bug_on(sbi, ni.blk_addr == NULL_ADDR); @@ -712,10 +713,11 @@ static void 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); -- 2.11.0 --in3frouciwuue7ko--