Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp813977ybm; Wed, 27 May 2020 08:38:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwdWc2+N56WempWSMWZ4QiXI7qGvOuxo8KO/z7HG4w140BvSMVOPCkZ1Er5P5Hj8s/JeQX X-Received: by 2002:a17:906:e0c7:: with SMTP id gl7mr6506044ejb.306.1590593904575; Wed, 27 May 2020 08:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590593904; cv=none; d=google.com; s=arc-20160816; b=WuK70u0wJ+1otjzGhNNQjXFzf7xHKLKitczjmgp43UzHa+pG7M9hlYaFLd0aY3Ss6D eqNbXfLK8zFZomPf3WlnzL3yvDii92GRJbuVJ57dJi7iVGRAlg0eZbY5bMbtPOZd+uDG YD5rqDPPTBR05uTkbkV1VtGESMxQd1PTHB25bbk/bKrsIr53ETTWPS+kCamCjIa0NhcU LCdPGAiraes2vZLtVRS051dV4T7A5oQY1qbVx/2dIIRX2xavdp6dDLPqouC7izXK7VQB nainq8ZxIq5V7WGmMUipure8ZV9FbQ8y75IcwpMW7B7FPWZ21pq9HF85x8Kpi6J1eHz+ T0HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=tBk34DCN1U9WdM2fgpDI20DBxSc9iUpO/gZuXrGQx70=; b=Uo7BORaldFA9QPJLxA3st/7T2ADfo7gQCME3IKTsmyngDjiPYxSwtOTjjqaTz0w3uU 8/6zdcjqgdzD+CCD4zYXisMcgZ4U8Oym9GV+SiW7J0JE3wUn/miYAxoGeQ4XGmXWqvBO u91EFST26hJqDk4Sf7hnThOMjf/NaQSlZgD7DItE4AS3eMhenva3d9KYaVOX/57Vlgct YYGbKM53NHYNOggRu7DNOsYDvGM7vVB0qFpErguvnWrvHmQUT61P9ws1Z0HJyJpcG95y fGBCwF8JGRN8pRwB3nd8gtTGmU000DikxSDud9HZMnT0kOKDWvdu8bOiZ2gEHcfpyPl3 kWBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si2296156ejn.479.2020.05.27.08.38.00; Wed, 27 May 2020 08:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729833AbgE0K2N (ORCPT + 99 others); Wed, 27 May 2020 06:28:13 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33966 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727018AbgE0K2K (ORCPT ); Wed, 27 May 2020 06:28:10 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 26207C1D2B936DEEF8CB; Wed, 27 May 2020 18:28:06 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 27 May 2020 18:27:55 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 3/3] f2fs: fix to cover meta flush with cp_lock Date: Wed, 27 May 2020 18:27:53 +0800 Message-ID: <20200527102753.15743-3-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20200527102753.15743-1-yuchao0@huawei.com> References: <20200527102753.15743-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org meta inode page should be flushed under cp_lock, fix it. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f7de2a1da528..0fcae4d90074 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2260,7 +2260,9 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) set_sbi_flag(sbi, SBI_IS_SHUTDOWN); break; case F2FS_GOING_DOWN_METAFLUSH: + mutex_lock(&sbi->cp_mutex); f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_META_IO); + mutex_unlock(&sbi->cp_mutex); f2fs_stop_checkpoint(sbi, false); set_sbi_flag(sbi, SBI_IS_SHUTDOWN); break; -- 2.18.0.rc1