Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2808218ybb; Fri, 27 Mar 2020 12:26:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu0YyWkaqW4W9EnE23R35hiHZNwzh+WsaIrvc9E2zNMes+Xi6c6eiXBood1HAbZoODWuF88 X-Received: by 2002:aca:34c6:: with SMTP id b189mr307757oia.63.1585337169822; Fri, 27 Mar 2020 12:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585337169; cv=none; d=google.com; s=arc-20160816; b=En+dXk2TtjbhT6bDo2A9ugbxHzZgG7dVEGFdNdHmKrq0Lf5L42SpuyEt6j9Y7vO4Es XVMTR3GUFsuWkyuY+Cc5vvMOuoapX9EEWD7rSlAarhDflQUlX6u9mJaUbzRz4NtrT3pw Vx8CoVJ0p3m4pBcK6ipoPK1j0n/qY88p8zT26/BjCD99g42jEfRE16pHJ7mxo4x4d6zN s9Tmqnhm8DwJAccbiVH4UV42mOd4+QJ1susEPqeL88S4GqVLvPa5S/QhCMd0ezaarQVi 7e5hnTUk6yCdQkRhhnVJXJ0AfunB1sUHg/Kq0eIUG7DNsSvuFMAcvYquKXLe857bxUKm gM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0Jg+NSaCBq8ZvjzxJ8A8EzD3xCV2UkZo5ORFxUU+CRk=; b=Y9ablQMDmXnMv5oAu5Iuz3Ix9qxUjbBNU1p7916JCNyk29/J+ePdLbSjzlVjGgK5QG /x4wq5mFraCwVCGsfJ7YqXe0sauMgwmUsRwueILozHl0jADXYVtBZJC0P9svfNjH/uRW aFsRLcstbd3aZUXxrxpchfVYGFAvSzE4v9SaA/6huZK7dB1Z8v0rLhG7y5FR2/DL+Z3t d1po+JSew/3+x+HeUNtxZXGuXalUFMcgkw6g97oe+rxh6YSGu02taKQ1E80VUsvAqYyJ gfBQNNUZgzK5ygR8UAzaEYoi/pIMXvzIsNcaBDPVyvlXLnEzsXe+GqcNHOGj1UUeCMiG acBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wxARzqqd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t24si2925777oth.319.2020.03.27.12.25.38; Fri, 27 Mar 2020 12:26:09 -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=pass header.i=@kernel.org header.s=default header.b=wxARzqqd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbgC0TYN (ORCPT + 99 others); Fri, 27 Mar 2020 15:24:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:59350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgC0TYN (ORCPT ); Fri, 27 Mar 2020 15:24:13 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A713206E6; Fri, 27 Mar 2020 19:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585337052; bh=qt6SbvEQShuKIl/6a/6slI+vmFBgRwo48MnklEokrOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wxARzqqdtgKfS3KjIlCaVHSzxYdqXgoeK01ef4pGrKZHx7IBEWmP6//vU0itLS1ZA /3s2iEbTmyJe1ek/xLn0FpWvYOyLvO8Obm3GNc+HhIJVHUYCCezTpT/nVdQG7C/asF J/pDGPCYUWB0WCHDi1+29HrTPxs9kR/XaxyFIaGQ= Date: Fri, 27 Mar 2020 12:24:12 -0700 From: Jaegeuk Kim To: Sahitya Tummala Cc: Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: prevent meta updates while checkpoint is in progress Message-ID: <20200327192412.GA186975@google.com> References: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sahitya, On 03/26, Sahitya Tummala wrote: > 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. Doesn't freeze|thaw_bdev(sbi->sb->s_bdev); work for you? > > 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.