Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1091870ybg; Wed, 29 Jul 2020 05:45:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKWfh8LqI6QAw3xR3G7LTEhhpEclEWdtxYa1M5Zrs5OzO0yl/vu0K8TWYIfk1V8zZl91yJ X-Received: by 2002:a17:906:284e:: with SMTP id s14mr30718312ejc.498.1596026743823; Wed, 29 Jul 2020 05:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596026743; cv=none; d=google.com; s=arc-20160816; b=A4whicte67ICgQmnhXF+49s/yZLhPuhLMbNJ3GB1wUMiBCXJrduh2bEk0ufqveBJns lLp+wm1QbjsGS7GSmspwWexrx9fcrsOlAC4ihZX3ZB82gP7qJo89rW/a1wYfPmfVeTz6 M4ql45QYhcXIpPyRI1Hka1eOL9YMhN8atyRgm9GgNDf0uISy7yjodgrlh+IBwOOFLPf5 Phw/TMv5t6/ZrNlDJON7u3yK9P+RYZYLExL9i5KwZRELTUV8eGJYRidwoJRB+JVQ7BPx BJGoA2yUssbsLj6FUup7+RdyozbM10EArdls5m/kbCGrvpWuCvFP7CHxHd+hB6mTGy2K WWfQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=wW1jC8hGuaTyKQN+P0l+pQbgm9XBFi+QHPJPhflJGo4=; b=Opdb2NSQzm0PvNUri0sUCw/tn8asVLn4n8kNM4ER2EgHC8DJA+8OXT7s+wvKT7EVCl p3AkQMJsnhcjirUj8GI1CRxZ8RCMWp3Zu0OyGjA/IvoBb8Kn03BSP0GIt9tCoax2LFog Z4/UsEkIa3GTwXIfH2ESl4s83x9aELhgZnU82p62aMKtKu40ILYLLEzCn9S3JBk3R7Hv TBrZlw5LFdPuwFOBSSHRDap6+ikfVYy6npO+qU7rC+02wdGsA2sFSGDX9aPwD7NDp2rc fYeyHc6fAZnmdmKvBP1myki1TCRh4g59dzgg21o2H9hPV7XGly/kdpAflkKe0bMnKfs7 KIVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=si9k9B1A; 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 w19si1087193eju.41.2020.07.29.05.45.20; Wed, 29 Jul 2020 05:45:43 -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=si9k9B1A; 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 S1726800AbgG2Mmb (ORCPT + 99 others); Wed, 29 Jul 2020 08:42:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:36920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgG2Mmb (ORCPT ); Wed, 29 Jul 2020 08:42:31 -0400 Received: from [192.168.0.108] (unknown [49.65.247.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D2142083B; Wed, 29 Jul 2020 12:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596026551; bh=mlZ/EsaMb/ND17rYj369D7zDyCStn7kc/8QnXsr1+ks=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=si9k9B1A5fSTY0airfSOHiXA74mNbarCYSzoFBGKhbT3Zt1iYPV0PvKsIYd6nfZja xxoDG+wWK/5289wsgOpBuhPGjKRMeLE95J80+c0eZnBZiRBLB1KqwawcAV+sLtRxb0 9gNR61RG39J1bpB63DDA7lPsipwIkQX7qEGXXoAw= Subject: Re: [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint To: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com References: <20200729070244.584518-1-jaegeuk@kernel.org> Cc: Daeho Jeong From: Chao Yu Message-ID: <054f161c-05db-73b7-3d83-be7addcd6015@kernel.org> Date: Wed, 29 Jul 2020 20:42:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20200729070244.584518-1-jaegeuk@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) 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); >