Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp443286ybd; Wed, 26 Jun 2019 00:35:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/LvGE6ufgeCnagYsMofT4Yi0OpXEKd/9oEMhIuGOsFpE/yAwGlg5CJBtopfihPXd72f/7 X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr3644227plb.76.1561534546872; Wed, 26 Jun 2019 00:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561534546; cv=none; d=google.com; s=arc-20160816; b=LbnPJkTQSrcz8dhcYJ5Q0V3BixJl+8XVCq54cDqQMqjEdqX48a6xCuFKxTjMGCABCl OXlAdNyOJK2GpK6WdKo4PKB503/3pAS7tws/LREsHgwTgupubXKhnjl5fFGpDUC5XQhe awVcHmweP7R7Knh1vtgHXylBQ4hV+SZtMMf1yvu8oUn3NtiEWw/tr33CpLqg7lTaH7Ub Y/eoDVMOUsMWDF8L15OPVgbByEVeFNbXbBsCX9tMljIP62Gw6mk2D8opwWBWv/hDhty8 x9U1LDVVi1Nkey08NAy+VBTBnoaEOfIZY+EDMSUBUE2j2oa2vYt9Inn4z7d24PuzQiAj nFgg== 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:cc:to:subject; bh=CDk6wS5Yg8j/NYKYuQ0HZVrMRF8uK35OpIM65yXZXhM=; b=mANGwIFuNn7UVEsqMopj9DKIYTAPO5idXeeGeTBJdzF3gT77S6Uth5wLSOZ+sUyLKp 2SAZwxIlG1uBGQlWWAiACH/fCCe9029776bHZj7Qla/33/2h8UclvpeLJ/Yt5uEXBg2q 1x+tboXG/jf7QH8UJBNJtH4ruG8NqrKWYY92ryLQh5lY0uxz7QT9b9Sky2hpy46QgW43 nEtnUpe/WJX1WYtILQL9k8BysfcxnXoyvoNwROPRTE6ARq80NPEenW/ACp3rRC77bg0m tLHsGZxl1DKBZYcnG8tR+Z/58NDqfMiEeA08T1yiWNh+aAcFQzVPNhnUxAJ4ETLMuCO+ n/Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si2746897plg.320.2019.06.26.00.35.22; Wed, 26 Jun 2019 00:35:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfFZHep (ORCPT + 99 others); Wed, 26 Jun 2019 03:34:45 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:19113 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725797AbfFZHep (ORCPT ); Wed, 26 Jun 2019 03:34:45 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5C1E63B40CC181C0051E; Wed, 26 Jun 2019 15:34:42 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 15:34:37 +0800 Subject: Re: [PATCH v5 16/16] f2fs: add fs-verity support To: Eric Biggers CC: , , , , , , Jaegeuk Kim , "Theodore Y . Ts'o" , Victor Hsieh , Chandan Rajendra , "Dave Chinner" , Christoph Hellwig , "Darrick J . Wong" , Linus Torvalds References: <20190620205043.64350-1-ebiggers@kernel.org> <20190620205043.64350-17-ebiggers@kernel.org> <90495fb1-72eb-ca42-8457-ef8e969eda51@huawei.com> <20190625175225.GC81914@gmail.com> From: Chao Yu Message-ID: <68c5a15f-f6a8-75e2-b485-0f1b51471995@huawei.com> Date: Wed, 26 Jun 2019 15:34:35 +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: <20190625175225.GC81914@gmail.com> 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-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Eric, On 2019/6/26 1:52, Eric Biggers wrote: > Hi Chao, thanks for the review. > > On Tue, Jun 25, 2019 at 03:55:57PM +0800, Chao Yu wrote: >> Hi Eric, >> >> On 2019/6/21 4:50, Eric Biggers wrote: >>> +static int f2fs_begin_enable_verity(struct file *filp) >>> +{ >>> + struct inode *inode = file_inode(filp); >>> + int err; >>> + >> >> I think we'd better add condition here (under inode lock) to disallow enabling >> verity on atomic/volatile inode, as we may fail to write merkle tree data due to >> atomic/volatile inode's special writeback method. >> > > Yes, I'll add the following: > > if (f2fs_is_atomic_file(inode) || f2fs_is_volatile_file(inode)) > return -EOPNOTSUPP; > >>> + err = f2fs_convert_inline_inode(inode); >>> + if (err) >>> + return err; >>> + >>> + err = dquot_initialize(inode); >>> + if (err) >>> + return err; >> >> We can get rid of dquot_initialize() here, since f2fs_file_open() -> >> dquot_file_open() should has initialized quota entry previously, right? > > We still need it because dquot_file_open() only calls dquot_initialize() if the > file is being opened for writing. But here the file descriptor is readonly. > I'll add a comment explaining this here and in the ext4 equivalent. Ah, you're right. f2fs_convert_inline_inode() may grab one more block during conversion, so we need to call dquot_initialize() before inline conversion? Thanks, > > - Eric > . >