Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp993375ybz; Thu, 16 Apr 2020 00:20:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJ/h/tvYuFBMKf3b/Y6g4HF1lz5eQruGZh2Z/nDpVeE8T3xnQ1f9rp7olQgJ4U7OGGYOmfg X-Received: by 2002:a17:906:6b1b:: with SMTP id q27mr8238526ejr.158.1587021601587; Thu, 16 Apr 2020 00:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587021601; cv=none; d=google.com; s=arc-20160816; b=hzH7Jvd2BHGQXB+J0wKTUqNnY3HwexgO3x2aUdxDOhp7NG/k+zNg44vSsu/R4Soa/v fZ50w2q88A8ZexQwms6fmZiqWxKNxsKMvfTxcluJeWJA+ZreY0d1H+5tVnoPvp77vMvT +wbFPUvA6e8GCxLmzSeNUDswcSSOnwRofAwG9j7u7h+1wlnL/Dvb5oenoMu32zy+YgME hiUjzICMmKPL1z7fXs+31cHnH9pn1t1PTJQ8LYg+Vfq9a10FttVg5cWAZc5xVtMvGktm 9GMQ4+DRDcJF/wwk9utLmTiAzuQU3TfRxtmGzlqxhgnLozMDPCBpGNptUILQGfnaU1Yt dCBQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=kTOF4O3uYXuhQ83/pzYZ92k2B39RA7mcH8xinhRdR/A=; b=n0sEI/+Qty4ZgP+oyaPEqXVvizHbmA61n8mCUQH3tqf8I5j8bZiC4mfY99BzlkKz8z Q6SHqMOFG/2VtIkSiMh4evp8VoHK25E5/gno19Sab0Kpx0kbZOtah8SpMoHgn/TVhfUh eLsYCwWxl2/jy8YunrW59mCG+S8aYRH5lc32ruisrw2Lq8GEaya+lr+iL47fq+oQlc8M J5PgVO0bayZ/6BxRl6FqkrYcGruO1ZNYw5vsBSWvBFPLwYpbsC1vm9230knQRLaTbrdV TOQhOIcLc8PuOp9W32LEHEjLe9zkHF2d8d0JeLmm6E43PbiyiZL6JXOjb2cyAkhrwi7Y dQtg== 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 dn6si1096576edb.514.2020.04.16.00.19.38; Thu, 16 Apr 2020 00:20:01 -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 S2438994AbgDPHQo (ORCPT + 99 others); Thu, 16 Apr 2020 03:16:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2380 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2438717AbgDPHQA (ORCPT ); Thu, 16 Apr 2020 03:16:00 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9916B9C4B29A166B4B0F; Thu, 16 Apr 2020 15:15:57 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.203) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 16 Apr 2020 15:15:52 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: fix quota_sync failure due to f2fs_lock_op To: Jaegeuk Kim , , , References: <20200409173056.229855-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <77e9f2e6-f3f3-8ca9-e6b5-3d57c4d2acc5@huawei.com> Date: Thu, 16 Apr 2020 15:15:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200409173056.229855-1-jaegeuk@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/10 1:30, Jaegeuk Kim wrote: > f2fs_quota_sync() uses f2fs_lock_op() before flushing dirty pages, but > f2fs_write_data_page() returns EAGAIN. > Likewise dentry blocks, we can just bypass getting the lock, since quota > blocks are also maintained by checkpoint. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/data.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 358c5f0bd6346..1139d8cf4b8d1 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -2707,8 +2707,8 @@ int f2fs_write_single_data_page(struct page *page, int *submitted, > f2fs_available_free_memory(sbi, BASE_CHECK)))) > goto redirty_out; > > - /* Dentry blocks are controlled by checkpoint */ > - if (S_ISDIR(inode->i_mode)) { > + /* Dentry/quota blocks are controlled by checkpoint */ > + if (S_ISDIR(inode->i_mode) || IS_NOQUOTA(inode)) { Should cover multipage write path, in the case of normal quota file (such as /quota.user or /quota.group) is set as compressed. Thanks, > fio.need_lock = LOCK_DONE; > err = f2fs_do_write_data_page(&fio); > goto done; >