Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1584109ybb; Thu, 26 Mar 2020 03:39:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtWo0GSTa4Qq+xBE3GsLcWRAGfpsVkiTksEJV2XONirj30UIHooUTXcqNIyMkTMw1qnnw4+ X-Received: by 2002:a4a:8041:: with SMTP id y1mr3872791oof.65.1585219176555; Thu, 26 Mar 2020 03:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585219176; cv=none; d=google.com; s=arc-20160816; b=pJpQ90nWwPeRQ/xRe283sEO9J69TbP1ZTT1nKJuHwnIwP+FABlYT0s5dFcglVSUXrH Ew7jnTX34P1WlIzIjKtU1xA6VjzyGhpPXRRNTNerfOMh0IYc3Dg/OBxWVKp9jJKUBhut KFilwQCzB1IgGczy1KFVdnBvw3rE04EMYhHcr2r9rFwhCmFO/BZXSPIpmJ3nPBWQGBW8 6ccyfWhdbYmQq2dGECL3u34imi92/KcemQYgSct9RncyoKXWpF4dTePGZSCns8z3U1bl y7+F6kWmzRI3RT7cexTiIZLKxH/OpKQSkJOxtmBL3mYvQ+YRcdIxufeeVZZAm9TovPQj Bleg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=ZvQ1jdFwqw7szV2N4aXKvGSeJpZKMjp8kiQ4LNqos/M=; b=eZ2IwjjiMfCG7FBE+fUMQcgByofYaayeB+zIbw/n6aN38oBE1os84q1a6LcGyL1j4l U/WBfT8rbc4VMM0e3X2z68vl+p1lDBIxcmaz8pexbWKXMNqdKLg7OnmINNd7Ijot0hxp ZiCQFXAHOPRH9Q01c0P6LYMjk7pHQ2NCjJnKhXye1UpA0r6y2g49GWk4NFKY63C889cx MH+Z0KB2UwRq2LG/nUIU1aToa6oveU5Jtxds4VKl6qrT2kj+RvcO2gJQ3KsEETm/STGQ NfOvBgvoTkUBn6Do6+TJP8kpMnvLS2ZoYwL7i6057GSZLH52tfA0Vh1Mls9jsHiKQReD fcIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=doQRivr6; 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 r1si816272oti.200.2020.03.26.03.39.22; Thu, 26 Mar 2020 03:39:36 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=doQRivr6; 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 S1727884AbgCZKiw (ORCPT + 99 others); Thu, 26 Mar 2020 06:38:52 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:45753 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgCZKiv (ORCPT ); Thu, 26 Mar 2020 06:38:51 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1585219131; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=ZvQ1jdFwqw7szV2N4aXKvGSeJpZKMjp8kiQ4LNqos/M=; b=doQRivr6mmeg5GsKW57Zb7umDIg0NV6NOmiVNnVWSSrWiQwWwlHsWI1KA/RMqf9rXIYKjRaD eArD76kh87lwFiQsjEVvlU4ujKuqSoFsWD5GF7cNxbzw6/39c37U1UQ5CTKsA4ryRXCB7WqJ 9DLry68T62uQRWjdZjMOBs10XnA= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e7c8634.7f0d2d2b5260-smtp-out-n02; Thu, 26 Mar 2020 10:38:44 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5FFD8C43637; Thu, 26 Mar 2020 10:38:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: stummala) by smtp.codeaurora.org (Postfix) with ESMTPSA id F2808C433D2; Thu, 26 Mar 2020 10:38:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F2808C433D2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=stummala@codeaurora.org From: Sahitya Tummala To: Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Cc: Sahitya Tummala , linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: prevent meta updates while checkpoint is in progress Date: Thu, 26 Mar 2020 16:06:59 +0530 Message-Id: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org allocate_segment_for_resize() can cause metapage updates if it requires to change the current node/data segments for resizing. Stop these meta updates when there is a checkpoint already in progress to prevent inconsistent CP data. Signed-off-by: Sahitya Tummala --- fs/f2fs/gc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 5bca560..6122bad 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1399,8 +1399,10 @@ static int free_segment_range(struct f2fs_sb_info *sbi, unsigned int start, int err = 0; /* Move out cursegs from the target range */ + f2fs_lock_op(sbi); for (type = CURSEG_HOT_DATA; type < NR_CURSEG_TYPE; type++) allocate_segment_for_resize(sbi, type, start, end); + f2fs_unlock_op(sbi); /* do GC to move out valid blocks in the range */ for (segno = start; segno <= end; segno += sbi->segs_per_sec) { -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.