Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1253942ybg; Wed, 29 Jul 2020 09:24:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzF5ph91SWsJhFEbKnTp+hJyXGUj/6uQXjNLW0IeOzmjgHggZGWUZCejnGEHeyRqTfyDa5 X-Received: by 2002:a17:907:7251:: with SMTP id ds17mr16970074ejc.289.1596039864953; Wed, 29 Jul 2020 09:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596039864; cv=none; d=google.com; s=arc-20160816; b=LOOUtVcJsnOwDGWMFvEJYLWITEzsuGRhP5+vQkE03QEAJqL2euRYprUX8LSNw6dyau PnSNHbrqGFcF445QlIOF176722rbnWXkTbx0k0NEUyfvLQFxdDoDuRfF78dU6+7gYX36 9gA9lBFuTjYvXssudKhp8/lYwqyrndzcm9kLRJE6C18eGVE35MLYBh6qYxl3baQkiyZj VKo33/Ddh4qZ4eaOrWrS0oeC5l6hy1Ix0nurophHYI8LmINEHQDWbsFRQrNHHblivMJS uvGykKqY9gYaWKC7HNit/hL7/JUX9dXusL9k7W4KaxL0+uBFbtK9HpPtEOyVBK9tIvm/ sEyg== 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=FjwOx/1YMnYWkBs5w+sbZtNz9UnliXhLhIMvmLD2uk0=; b=p/PA+KvZsUn3xEndvbeCXcrUZmJIx79btNeeyFvnQlm+e7eFCa5rYfa/iL9D5HodHR +bm2T5TSt+1yZDxn5nPmwHkF/sVF0e/POxy5L3gxgCaWFTI+k/bgnxScOQHk8LVEzC7z uzjjIKZb9iU/pKhMaRVvsOV1pJ32ZgRee/2NEMROBHH1BH7kbXIPpFxNDJ7yL1lkax6Z G6Jk89g/El8cfcsO6JBxDtaBDGHUSfc7yFO13NXVowjQz9wQ6mLJzDLPtauQsx4Aop2k R0jj7hJxkiOD6rqUJcLvoBeFDlAiMuRmsLHySNO+QP8YqMyKa0HDzpdUN7dtYJgEc+2r QxsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Byo40t5P; 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 p9si1492911edh.42.2020.07.29.09.24.02; Wed, 29 Jul 2020 09:24: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; dkim=pass header.i=@kernel.org header.s=default header.b=Byo40t5P; 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 S1726664AbgG2QVq (ORCPT + 99 others); Wed, 29 Jul 2020 12:21:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgG2QVq (ORCPT ); Wed, 29 Jul 2020 12:21: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 4FA8F2075D; Wed, 29 Jul 2020 16:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596039705; bh=kU7UT3i0MXW7gqzbaCFlt/VbDV/ZBUwOIl76CXUqX2c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Byo40t5PhbmfTgovNn4pTryjQyJPinICU2cOtioUZM9MofRtpmqMkeY+Cri6Gb+R9 uKjxjiG4JQdUMbNG1WjF+crg9tQ8vQvJ0hDGyKOcWMtTP/Vy6nk9OYz2qE8gy+vo6Q z5/2p7KaXf1M0R8ovcuf5rS/UWswH3NSXXsA9NKI= Date: Wed, 29 Jul 2020 09:21:44 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint Message-ID: <20200729162144.GA1460954@google.com> References: <20200729070244.584518-1-jaegeuk@kernel.org> <054f161c-05db-73b7-3d83-be7addcd6015@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <054f161c-05db-73b7-3d83-be7addcd6015@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/29, Chao Yu wrote: > On 2020-7-29 15:02, Jaegeuk Kim wrote: > > 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 > > After commit 79963d967b49 ("f2fs: shrink node_write lock coverage"), > node_write lock was moved to f2fs_write_single_data_page() and > f2fs_write_compressed_pages(). > > So it needs to update the callstack. > > - down_write(node_write) Yeah, applied. :) > > Otherwise it looks good to me. > > Reviewed-by: Chao Yu > > Thanks, > > > - 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); > >