Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1211957ybk; Thu, 14 May 2020 03:22:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyTKxE6g4hH2GOAbEzPPzZKW5uWBoaLrHWcS80HArNZ1no33htRqBIgFMXfyq+j2q92Q1U X-Received: by 2002:aa7:c60c:: with SMTP id h12mr3068085edq.243.1589451747262; Thu, 14 May 2020 03:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589451747; cv=none; d=google.com; s=arc-20160816; b=y9rHEKKyklx7W3Px/tObgH5myv39EoAMvJtgqRcrgbuV/SWSznAJpm028P8N2oLKYM 2GyPRVDwJPtheB/ZYAOHKLDOl4NBS+A9Q/5detcWlutIGAA+gpyouVq/2D3AILYqWMDZ ODGjdZFtM+xho0ijtSzHxuhEyfDSKGJXffnHJWQ7sk55T9Hzw/DVAMUUZlKPQebvz46Z L/zAWrV3N5SIFwu5fDgpk8nXjOeCIJP5wdLD2aC2ee7yftHb/Yh69bEPZUP5WhBfFSH3 o4MgtLwYqbxYcT83i0CDTwvLltRWXuKth0PDFIaEZE+4PRV/nzBa0dcZ1Fr9fUE5AjCr IJVQ== 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; bh=w8odhEFi/P3Pg1B0ejRJMG3u6thr0EjBvN/i1z/sTMM=; b=WIQ8tXrTEEx5HOO0GcJi/QsqK4IJQp+eJeSwJQGSN5/7tWbhDWF2KYUb6Ye5EYxDmT HmYjALlLzgNBH5CZ+LKsxc+1pu0HCeZcRujtTUAPRCLQ5WqCsfKVpZe2Y0857GlpOXv7 iaV1K9/5gjoUjBwcrWL8lyDxydKcRvsU7JNerbwhEaJ04HY2lDw+LR+hp42KWC0n//ea Jzq5o3iK5Spx9y92O4N2xKrz240S7PsRga5HPAnHyoIsrMpmiwDIwRr5Vy3SMTBsAisq SxjFPh6s88Y5tpGpTLzdsb1cp5D5IAskXzPW3bAXBOxjjqu2vKb5iM4zn8g88fj+Z96s agag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 n8si1468319ejh.210.2020.05.14.03.22.00; Thu, 14 May 2020 03:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbgENKVw (ORCPT + 99 others); Thu, 14 May 2020 06:21:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:55098 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgENKVt (ORCPT ); Thu, 14 May 2020 06:21:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E8958B023; Thu, 14 May 2020 10:21:49 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 6F66F1E12A8; Thu, 14 May 2020 12:21:46 +0200 (CEST) Date: Thu, 14 May 2020 12:21:46 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-ext4@vger.kernel.org, Andreas Dilger , "Theodore Y. Ts'o" , Jan Kara , Al Viro , Dan Williams , Dave Chinner , Christoph Hellwig , Jeff Moyer , "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V1 2/9] fs/ext4: Disallow verity if inode is DAX Message-ID: <20200514102146.GD9569@quack2.suse.cz> References: <20200514065316.2500078-1-ira.weiny@intel.com> <20200514065316.2500078-3-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200514065316.2500078-3-ira.weiny@intel.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 On Wed 13-05-20 23:53:08, ira.weiny@intel.com wrote: > From: Ira Weiny > > Verity and DAX are incompatible. Changing the DAX mode due to a verity > flag change is wrong without a corresponding address_space_operations > update. > > Make the 2 options mutually exclusive by returning an error if DAX was > set first. > > (Setting DAX is already disabled if Verity is set first.) > > Signed-off-by: Ira Weiny Makes sence. You can add: Reviewed-by: Jan Kara Honza > > --- > Changes: > remove WARN_ON_ONCE > Add documentation for DAX/Verity exclusivity > --- > Documentation/filesystems/ext4/verity.rst | 7 +++++++ > fs/ext4/verity.c | 3 +++ > 2 files changed, 10 insertions(+) > > diff --git a/Documentation/filesystems/ext4/verity.rst b/Documentation/filesystems/ext4/verity.rst > index 3e4c0ee0e068..51ab1aa17e59 100644 > --- a/Documentation/filesystems/ext4/verity.rst > +++ b/Documentation/filesystems/ext4/verity.rst > @@ -39,3 +39,10 @@ is encrypted as well as the data itself. > > Verity files cannot have blocks allocated past the end of the verity > metadata. > + > +Verity and DAX > +-------------- > + > +Verity and DAX are not compatible and attempts to set both of these flags on a > +file will fail. > + > diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c > index dc5ec724d889..f05a09fb2ae4 100644 > --- a/fs/ext4/verity.c > +++ b/fs/ext4/verity.c > @@ -113,6 +113,9 @@ static int ext4_begin_enable_verity(struct file *filp) > handle_t *handle; > int err; > > + if (IS_DAX(inode)) > + return -EINVAL; > + > if (ext4_verity_in_progress(inode)) > return -EBUSY; > > -- > 2.25.1 > -- Jan Kara SUSE Labs, CR