Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp897765ybg; Wed, 29 Jul 2020 00:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfzW3o9pNOwvnYX8Gyg7WWVtFQ/hmxIWvzUQDoHm4fnYKwIMxDPdJpppWALlrg5BX2sM5F X-Received: by 2002:a50:cfc6:: with SMTP id i6mr13778917edk.88.1596006219199; Wed, 29 Jul 2020 00:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596006219; cv=none; d=google.com; s=arc-20160816; b=HmsT09bzd3pVqh4BEUxHh401iPs7h5j6iyfDO5DdsbLlPJmDki8P2mXZCIHREM/B7T em+B9De8hnL2WOYnjb3CUmoGF1tICE9jZoruRCZWGEaQDuGZX4nsrHAYcjhsvW3HDVoL HB21c+/RCLBL1IqxnQmefmFztikDZ0SGrMgWL0GkLUkR+XQKOte8ZsH13DWWnAUAbgbh v7OqcAPotTCMZlXAM8E++0eacChTQGJF6ugXUIlFL+5tKA8G7Kf249L1kgBYLsT2VPgl JKPLboCUXMQyt6KLlzzn6uNToIxEiwZgCHkoW7gGj3E7oHAlhbvLvY6zGzcyk6rYeP/k ZjAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=O0Qs6FNPWR3Uw7NQQ64Eec1/TRTmwikPksHxVzrFFaA=; b=x7uJgc+/U8rSQcQTRoOdLgMuXdQD59QTybJ71Lv0D2XxwDlaKgc+iKcJESjA6nxnXh Z9UxUARiG3Mp6kSMHyHStEnOQJt8TVBIBZRjGp0LJgrSNa5RonXgr+06dPs9Q5jHZZhA kE+sl0t5LL3F6EzIxpKGMbi+b8h2HmrybLAsIRkRGFtN6+xjqNPePQoqqqUXawqmRwmV jwF2N4HdC9Uxwe8V+kqZqjgrxoOMOlI9A6fx4iwK9dD7T9TK2PMoUDMWQR1RltoMPpQO txQuXrN36ci3KoBo3LyR9nxaW8IQutNv60BJ6DYuqDdK9B6NSKkSlmY1wBV9Sy/F/9Ed h9BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KlNOKaUx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si553650ejr.212.2020.07.29.00.03.17; Wed, 29 Jul 2020 00:03:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=KlNOKaUx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgG2HCq (ORCPT + 99 others); Wed, 29 Jul 2020 03:02:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbgG2HCq (ORCPT ); Wed, 29 Jul 2020 03:02:46 -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 D99112070B; Wed, 29 Jul 2020 07:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596006166; bh=PsG28ZKBgOwqSDbxUyTDDzHrSZ08sLR2QQcOJCPJkbg=; h=From:To:Cc:Subject:Date:From; b=KlNOKaUxeBPVXLkj+pydQcG5m7sPnUW6DnUrO1n1hlDwdy6+BUgLgBCkM9dPrv6uh o6+5xOO/UsOYrvMc97JJNWyz1cNIUoHVG6BIf+NEkzghCrLt81UkA6YZQSWmcmfEZp /JJ3LPd10QyBCUSEbkgjBSsvpB+t/zQe3qdvyi/g= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Jaegeuk Kim , Daeho Jeong Subject: [PATCH] f2fs: fix deadlock between quota writes and checkpoint Date: Wed, 29 Jul 2020 00:02:44 -0700 Message-Id: <20200729070244.584518-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.28.0.rc0.142.g3c755180ce-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org f2fs_write_data_pages(quota_mapping) __f2fs_write_data_pages f2fs_write_checkpoint * blk_start_plug(&plug); * add bio in write_io[DATA] - block_operations - skip syncing quota by >DEFAULT_RETRY_QUOTA_FLUSH_COUNT - down_write(&sbi->node_write); - f2fs_write_single_data_page - f2fs_do_write_data_page - f2fs_outplace_write_data - do_write_page - f2fs_allocate_data_block - down_write(node_write) - f2fs_wait_on_all_pages(F2FS_WB_CP_DATA); Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 8c782d3f324f0..99c8061da55b9 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1269,6 +1269,8 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type) if (type == F2FS_DIRTY_META) f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO); + else if (type == F2FS_WB_CP_DATA) + f2fs_submit_merged_write(sbi, DATA); io_schedule_timeout(DEFAULT_IO_TIMEOUT); } finish_wait(&sbi->cp_wait, &wait); -- 2.28.0.rc0.142.g3c755180ce-goog