Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4032690ybd; Tue, 25 Jun 2019 12:49:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUG1nOhukKuWHUB3SqaMuTgaCUfIXUbbvC4GXGTgOo6NGtT86sz9uWT1irKWcWVTVKLCN2 X-Received: by 2002:a17:90a:376f:: with SMTP id u102mr621285pjb.5.1561492151283; Tue, 25 Jun 2019 12:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561492151; cv=none; d=google.com; s=arc-20160816; b=MzaeZIH7a+MALFWUoUaNnHCp+ZF4U5BYm4gOi7HK4X5sj+Vn7OqRyzMx6SaHYbzyqa 7rNUMVFOX8KoJPrrfk5f1EUv5jWr8CfmBuejkLQkH0h9E7K5/OycIw1ud12TuvwdMZ6/ WXQpylRvwgrJ9hPXvH5elKpi8Y1Mf60t9yNp3SG2UX4XqnOTZaCKcvxvKt7zEWBessnI MSq3pbq8PaeEZ707q6mBr+/HvQVScDeRZSmfb4uIwxZeabOiKNfJAwInMFf4kjZwLVef RjBmhpqkXK64JUxNAeatjaNxayIApzloUw8/Dt/3qwzxJgwJpLo+x7reJHiXo2XCIQEi 9Hvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EcWPrq2o5lkGnZTGHuqWaNWdoelkSdjwjAmnzxHCn/U=; b=b1dsKhtkmeS7T3XYKnjJP5GX6vWW2iywAL0qOK4WaVlzdZG7HyquyPC5reQj9O7ikb eHgEaWlR1iYvvSFchs3+pD/UlSS03bxoxMDlZ8sIVFceV7nu0QQAjeE+h3RfV52qvuA1 vlz7RcJNsbAxz4FA4cB1IREZ9oPGtUn8oMoB8JpiCQPChob6jM79eG2RLd3J3uMHK4C5 RGenpdSkNPmrVY3CvdLnCx0+jHLhEo22qGmBFm2ZpNVDTrJGhBFV656bp0KUvaph7bZU 8tHJdHFYXkBte9O2l1wQ6c07oJBnAeIsN4F294+3zfGCzDsiqJWi2OmBYMxVmGZ7+6My kuCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DjAOE5lD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si72343pjr.47.2019.06.25.12.48.57; Tue, 25 Jun 2019 12:49:11 -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; dkim=pass header.i=@kernel.org header.s=default header.b=DjAOE5lD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731588AbfFYRw3 (ORCPT + 99 others); Tue, 25 Jun 2019 13:52:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbfFYRw3 (ORCPT ); Tue, 25 Jun 2019 13:52:29 -0400 Received: from gmail.com (unknown [104.132.1.77]) (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 2756320663; Tue, 25 Jun 2019 17:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561485148; bh=wyycSt+pI2DJX5K8aByDIu1qndou0ZcC3vKhYC0f3bM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DjAOE5lDyE7nFLOiJ/TjmGzmXakZCqaiO7KZ4EjtP6/qEVCgSX/Fym0WfDE8dHEU7 TVqGc4cKyWEW9szMmQezxKmszLdo28xETW3HIk2BO5u49SUH1z9G3kxm/PyvTbUZla rhLWkPZS8pNpuwPX5N2EHJ5EymKNGv0664ZbxDz8= Date: Tue, 25 Jun 2019 10:52:26 -0700 From: Eric Biggers To: Chao Yu Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, Jaegeuk Kim , "Theodore Y . Ts'o" , Victor Hsieh , Chandan Rajendra , Dave Chinner , Christoph Hellwig , "Darrick J . Wong" , Linus Torvalds Subject: Re: [PATCH v5 16/16] f2fs: add fs-verity support Message-ID: <20190625175225.GC81914@gmail.com> References: <20190620205043.64350-1-ebiggers@kernel.org> <20190620205043.64350-17-ebiggers@kernel.org> <90495fb1-72eb-ca42-8457-ef8e969eda51@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90495fb1-72eb-ca42-8457-ef8e969eda51@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. - Eric