Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1141429imm; Wed, 1 Aug 2018 10:52:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpckmUN2dkO8Zx6a4Lc7P6VysM1gHWPU5Ce62giSt2OYBE7bC+pDeMdmKEogYDsafcOOgnZV X-Received: by 2002:a62:d1b:: with SMTP id v27-v6mr28256637pfi.87.1533145958050; Wed, 01 Aug 2018 10:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533145958; cv=none; d=google.com; s=arc-20160816; b=s889RCYhG9htRsO6OrDqa7goSo9AkKR9uhiklQGqr/I6hD/gv/k7dz7Okc8vXEaSAk NO06tYioruTTMcqcsYU1hIakRks2KCAWR8MMKXtAuPFbIpFMWbuxDw66m33h+ROta1xQ rsM+yz0i8MBKJv0Gh5cbyNGfTInjH0o0T3y3nEbqIhTv4NB7sILoW3o3WuDyPXTSNjfX kqQpYMCFJbdIGFxvtqvnjlLGTWlL4a2OXV5jzj5/yDq5fdME3BXZ0zwCwQnHOznYcetz WUKtyNLhEXuf2GxyNPb8y56cG/9cyNyQsVsRCUfnCAjxl2Iw/K7OBNZzBUXazEQ1FJWw uyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=t/ynfXddHKjf9Ho4d2p9czaB8aoeCpMwF827iLAg9cM=; b=rs2/a7X8DIbwgtAA0RPENVUPnsAiV3qz6qEZk4SVzJyaF8xYQqEnM6DVJIE9AhEBcF YWYb+bC3803RTeC4fj/CAQI2QeMGpUZW0ZxRF0/BDULz0bwN99GZvq1Fotm+BarZQvy4 fmlsfK95D5VVOHtg6wgCTWS1vzBFI5osXcs9Uy9n6UF89K95l4W2wshtLmvtwStEMyHn WHhy/2L1978QkgCeeVt3umVsrux1zp0/f7JF8GM6zfewqcTONIh6LD7JneRg8D8elnfj vM9EFlikfEMYtt/Fa/3acJkkzYGaJeptUGFDUKhBsMfrjBlnN+bobNjBBEfyGCTnc+CB e96g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si11354022plt.342.2018.08.01.10.52.23; Wed, 01 Aug 2018 10:52:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406109AbeHATIm (ORCPT + 99 others); Wed, 1 Aug 2018 15:08:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50270 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406031AbeHATIl (ORCPT ); Wed, 1 Aug 2018 15:08:41 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 78559139D; Wed, 1 Aug 2018 17:14:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.14 056/246] f2fs: fix error path of move_data_page Date: Wed, 1 Aug 2018 18:49:26 +0200 Message-Id: <20180801165014.394074082@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chao Yu [ Upstream commit 14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45 ] This patch fixes error path of move_data_page: - clear cold data flag if it fails to write page. - redirty page for non-ENOMEM case. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/gc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -768,9 +768,14 @@ retry: set_cold_data(page); err = do_write_data_page(&fio); - if (err == -ENOMEM && is_dirty) { - congestion_wait(BLK_RW_ASYNC, HZ/50); - goto retry; + if (err) { + clear_cold_data(page); + if (err == -ENOMEM) { + congestion_wait(BLK_RW_ASYNC, HZ/50); + goto retry; + } + if (is_dirty) + set_page_dirty(page); } } out: