Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp41065rwb; Fri, 19 Aug 2022 16:26:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4O63PJqBTWYtxIAN5Az0fVIODc5JyoMdG1kyCFM+kQ8QtL7qLgjGNLxPw3P0qPKh1uHiPh X-Received: by 2002:a05:6402:f0e:b0:43d:61d6:bff9 with SMTP id i14-20020a0564020f0e00b0043d61d6bff9mr7497017eda.78.1660951606918; Fri, 19 Aug 2022 16:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660951606; cv=none; d=google.com; s=arc-20160816; b=d94XyUEef1pQS0v72amjrHiQZbhLIK7OIkS9fwHC0CLD5V0wqfl+rMyxayLNQ2sJiR Xd5ADD9X8j8RMfZZitfym5GqTg0dPQURGsXcBEOkaMqneA6BX2WBJA4WjAFhRrbZYAD0 JfjmqZTY0EOLPcXV6yiLQCbv2dh4oLGA6NImFE+mXbMaRZfa+NC6sC2xxbY33yGYZ951 PZjdUCCqEAxbRRF/MDp3Mx3KiOQ7BnJNh/cdkn4304jKA3vEqylEZPiroIzpudSU3Tu2 Tm0wKbCo5mzn/sJgOkx7XI0EeP56GAHdeOT9vA0DcBTRwhbDeRMb1nsrXSVgCDuk+o3c ZwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WsFg5oNHrmidMjG+EQrZyB99LO8ZLfl7r4On0SYA+b4=; b=LISBqq1Rxgpx5BUXuKUcTm8lEYSBtZgVuPNTeqpZnfiZ9cJFGUtqYlTG21l4A6162Z Q+Oc/43BtnAqQLRMWc/v5uRAOlrGXr2z5HrU8vT8u4W2ya7PWlwE/TEES2K59HSSFUtV ZvWV38TlQKZbqmGRDPvLwxnsXDsJABRRcYt2z62ayB+duDiB/vPDwzfai/dO9RWacenC 1xgQ55ULzm8MOF4EGk8TLYCI/SkH8UFJZDrj7K5MuBIMNv5Mesa/32yz9zerP1phmh4f tE87gAdGPxzHn7SummgFleRWgjdBTazR74GiudT8bDOMJkmpHg7eZ5McDx29fluR0n2y 3Qrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q8IGFuqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y61-20020a50bb43000000b0043ae03d2f9bsi4097804ede.459.2022.08.19.16.26.21; Fri, 19 Aug 2022 16:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q8IGFuqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S244099AbiHSXPl (ORCPT + 99 others); Fri, 19 Aug 2022 19:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244032AbiHSXPV (ORCPT ); Fri, 19 Aug 2022 19:15:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83DE0E3963 for ; Fri, 19 Aug 2022 16:15:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 220436186B for ; Fri, 19 Aug 2022 23:15:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 790F6C433B5; Fri, 19 Aug 2022 23:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660950918; bh=hsH/o/XnOoVziPjmhg1KsTFQFW0lzFCZrIpev5lAsvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q8IGFuqf4kKfjLuk+gnmnFzMccXzWYDvzPwg6rpVCNI9Br8FzWbbwKucztcrJS98W 2ycsDmO+/bmF9bdR7uGyYcgfOWBzpI4C127aUUaD1Dl2nGdFosQGqCy/AUNa8BtmrF UHJT06DJiSOk2ZQ54Z8G6xJsv9+JCombZoftfhAMmZqDbsAe8avKCCQIYBGTU3h+My l+53bQFMcxxUMK6bVhUb55sH6tdScxOvB+D7W0yeTZGVx20KmPzHaGYPYXqRoEN8Z8 ZXMFN18qOc0wfiDFBO+RXZcakTSQ7+jhCbDqUC9GzsOu5kxtJfSqVh2XixcWDvND13 zUSj0Xtl7tIWA== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/2] f2fs: complete checkpoints during remount Date: Fri, 19 Aug 2022 16:15:14 -0700 Message-Id: <20220819231514.3609958-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog In-Reply-To: <20220819231514.3609958-1-jaegeuk@kernel.org> References: <20220819231514.3609958-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise, pending checkpoints can contribute a race condition to give a quota warning. - Thread - checkpoint thread add checkpoints to the list do_remount() down_write(&sb->s_umount); f2fs_remount() block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 48ac3de4a533..88879c483805 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2349,6 +2349,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) f2fs_stop_ckpt_thread(sbi); need_restart_ckpt = true; } else { + /* flush if the prevous checkpoint, if exists. */ + f2fs_flush_ckpt_thread(sbi); + err = f2fs_start_ckpt_thread(sbi); if (err) { f2fs_err(sbi, -- 2.37.1.595.g718a3a8f04-goog