Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3359627ybd; Tue, 25 Jun 2019 00:58:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9nAQH1YDqoQgGm7mU0krnwxictUE8qmLzl3jV1CCJiqDBEhda48l6y0xdSzWQ8qVGCRM8 X-Received: by 2002:a17:902:7297:: with SMTP id d23mr140280471pll.254.1561449489755; Tue, 25 Jun 2019 00:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561449489; cv=none; d=google.com; s=arc-20160816; b=LOxUjRfcuL3K6vUFghNyLLLRh2OE41wex1eqagG28AFArcM3L0bP0zyFN1IE2OR7EM 0G/U8yZxmk2gBAny+uo4736EdrxmOZlrrT+F4jCNoopZApzfXmHn86NJvmtOaWLJyz7/ 5yGGEBL2hGa/CZ8gPV7c1MXam4lErZUrs5kx3Wis/IyUCdbelgSQESgf0uzoxIIAnN85 hvknVhTg4+6uBQDXWQHZ8CthUK3sBSDAfPhjOI6f8ysnUNw7FN596QjRikQu5eXr0WF3 NtKRY3jP/DKSrdvji345raCOqxKNrqWnp3EmnGIllpj4TtUWxB8aasrh29J2mm+jf23r 3VjQ== 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=7QxID8fNGW6n9kiIwQwKyOc/MdT7eQo2az12BOj+qns=; b=eY9ZIsqjxBAI9i3OXW1qroyG1aEnevV/Ptenq1zUhfFsNDjj2KhgfDKf6hyOYr+8/T oT37fN+fwe9DubRNw/xzQhPdBB97SnjmAlaomcMsPWXqBOJpMrWpwzg7/kUcwYlvJlcL u/+HSwPqkArV7kTJZkwV+Lqca/5DpeRMu6CQNj18dOlYrLvYJW6l0Xpk1xsef0ZZ2pzc lJ2v48WSE8SVmlF635BP7fbItn4d4hB3uqYYhopU7AvPyL6m7jGoKDI7yJKAIkGbPhpS u4Yyt/zGakvT7QBbZzipwoLhPKFRn8PnUn+pccMT3g38XBXypmcRYmPkD325oibz1Ii9 +lkw== 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 v45si2919049pgn.305.2019.06.25.00.57.55; Tue, 25 Jun 2019 00:58:09 -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 S1728810AbfFYH4H (ORCPT + 99 others); Tue, 25 Jun 2019 03:56:07 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33800 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726543AbfFYH4G (ORCPT ); Tue, 25 Jun 2019 03:56:06 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3AEB77001CAEBEF3AD3F; Tue, 25 Jun 2019 15:56:03 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.214) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 25 Jun 2019 15:55:58 +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> From: Chao Yu Message-ID: <90495fb1-72eb-ca42-8457-ef8e969eda51@huawei.com> Date: Tue, 25 Jun 2019 15:55:57 +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: <20190620205043.64350-17-ebiggers@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-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. > + 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? Thanks, > + > + set_inode_flag(inode, FI_VERITY_IN_PROGRESS); > + return 0; > +} > +