Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6064802rwn; Mon, 12 Sep 2022 20:32:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7j1NWSvWijD1MNf3AQsEfVPZftcrT2QPYHEdELuiz/GMUmdU2SrzyjuZU2hJ/j98jadmPq X-Received: by 2002:a17:906:4fc6:b0:77f:ed68:d998 with SMTP id i6-20020a1709064fc600b0077fed68d998mr674428ejw.549.1663039947818; Mon, 12 Sep 2022 20:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663039947; cv=none; d=google.com; s=arc-20160816; b=A1tMN3Ru2UJDpbCKeMLN55Io7DyaToWVrPn0dDvukXesQTGtJ9anNcCrjV3fc8RBDJ gZgcOxvXCPZi0HV/o0p0TwZ0AhHd0eU+acMQ7qbbvTP+Bzg8M8Hk9hLOJLFBHlhJdTbD SVJkx31/qnKvgPwlnFmV1q18pxU3Thb9eQ7H4fLfiV3kqW2ECaQStZI1Ribi+X8WGcVK xNYTJyaEH1frb7maVqy5ePozcuf0f7jTRJpKz4Zi7QTva2hK49gOLm9DcHJuWSNifekY VfnIV6iMcyAL8Rder1Fsuo/GT6b+/dxoDJ3kD9TS3M0SAW6LPICY1K2X8W0fSokTIg7t 3SDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=n7I41PUpS+iHbETfQn5WmxK5EdVObpmTZ6DEyC0XJdA=; b=nurcyVkHVzYxagLVCXgjKSe7VVF6ecJ72GD4BQfCZk8lQQ30oweu17HJFSA/28keyB jwDMvwKjtVf3XsvyA1B0CHBnB1f9Cd5g+rPLW9PwILOEpG1QFyWriXOiAHybemLyJb/L l06ur2Kgt2CDS+mFJlm9itYpJSGXeiy2xtA7W8GGpXZnwb2UKPLuKPg7Uq1E1yAAezLp CeJRka3RGSPhA1Zca7wzUhWDb9wwDzxwTj9WrYv4Urcj32f2oEo888LpiRn5FRsgZjts BRwuqgz1cMrr6BzmDOgu5SdXPx8HxSrvPXhqo9tSu0P8OpFOK6mMTyRgA2eXoP0XbPY0 QgOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jg6Jw+Rp; 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 sg20-20020a170907a41400b00778a543a05asi6550254ejc.226.2022.09.12.20.32.02; Mon, 12 Sep 2022 20:32:27 -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=jg6Jw+Rp; 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 S230130AbiIMDLf (ORCPT + 99 others); Mon, 12 Sep 2022 23:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbiIMDLb (ORCPT ); Mon, 12 Sep 2022 23:11:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8ABA53D3C for ; Mon, 12 Sep 2022 20:11:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id 54664B80E0E for ; Tue, 13 Sep 2022 03:11:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14998C433C1; Tue, 13 Sep 2022 03:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663038687; bh=T82nGUCNImec5KMWq8d1Rk3J3+w64aQ6jgFDyTq/njw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=jg6Jw+RpYDfVREd/4Ipyatsnyv5+EI3o7gVvwtQwZNYswbGDXsJ41NlNDwl5B4265 KEbyW6s43OSRFTx0Tz9qf/smJYBcOJ2zvkCXdQnlnqdaBKPPDH8wPdpoL/ASjPlJW/ o59obaVTdh6OIjzg0NoxU9H5EM+XZjxKsqQUVGC7aXzs0YzCGNtDgjQrcvPOdE4iry B528uq0Rg0TcbSoom1szEQd5ICY4CzJUIxenJPyRbyhfg8EiR4I224dqQUIKeXToMp GoVuK6RqrfdII7UHERsgHDUO2pBWMZF9e3wHF8HhRB8VxeDi7i9IOkAnh3C8N2kADW E/llEWOoQ78/g== Message-ID: <791f5692-0814-2bd7-712a-829e1cedb891@kernel.org> Date: Tue, 13 Sep 2022 11:11:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: complete checkpoints during remount Content-Language: en-US To: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20220819231514.3609958-1-jaegeuk@kernel.org> <20220819231514.3609958-2-jaegeuk@kernel.org> From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 On 2022/8/25 4:30, Jaegeuk Kim wrote: > 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)); > > Or, > > do_remount() > down_write(&sb->s_umount); > f2fs_remount() > create a ckpt thread > f2fs_enable_checkpoint() adds checkpoints > wait for f2fs_sync_fs() > trigger another pending checkpoint > 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 Reviewed-by: Chao Yu Thanks,