Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp658337ybz; Wed, 15 Apr 2020 16:06:29 -0700 (PDT) X-Google-Smtp-Source: APiQypKPOYlTcKYr1OZ6LFEBDM5uuSx0NbtdER1zbWfHJ63wIOP6oSPzTfoguPqGw3ftVfvMzdYS X-Received: by 2002:a05:6402:2059:: with SMTP id bc25mr1724121edb.227.1586991989434; Wed, 15 Apr 2020 16:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586991989; cv=none; d=google.com; s=arc-20160816; b=Dd3MqMchfhnoifR3UF3Zn6D7nuM61p+79b5yMlZ/9bdSqIbOmR8M0EyepwBGeXKkYL eXYmQHW2u90XA10HS4nxnYFluyJdDkt57zBTKUn2YZq7ubCreoa3IQtT5zCbyal2DT2T BAJjiuG0tX159zzAJ9gnVMq7ewh/vsaMAizZc03pb+8sxqzU/hUoEniwb61KohvkNREd vY2aRP3uwfoABLgq9ojo/CwCwucDu2Z9oTbY6/s9KGvc1fNZyR4i4vneEf5LPW88SH8O XAsodlFrhk8tlykKyE6cb/Ds5ql+PIk3pFzguUv54NXwGNsJOLFaqzDNg8kbykqrYo53 6vHw== 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=ATAkxD4dCDWgm0sxCcscHAd83WGi6aQZFF23A6IWDi4=; b=noAWP+F/Y31zM+lULOEeRO4B5ylQA9BkDvhtLjhhJURaxuiTcopqp+43xRu6+E/74Q hXZN1MfqKqlaQ56Gkc1guOcisS8I0Mmy+E3g2/eUDYH4qRjU1xPcZ2xOmyJK3mqP7Xec EzwVY1lZZDNXOJQns85GwfP0k3cFk/+SuZ3iooYOBAVxgCKju18SrDc8WH79OTpodd81 g1MoqGZD4jGvGAoO9aR7ebLbk7JuRuMnlagLXhzc6rYPblTEPSdUvfci5ZgjtB7ScXzk 3sOuYzyP9tFAUAMBXAS3GRX3o88M9WlPvg8tTR5lPlaifpQAp6lGOWgqP7BVlBeIwMX+ oE/g== 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 s23si10963559edy.522.2020.04.15.16.06.05; Wed, 15 Apr 2020 16:06:29 -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 S368074AbgDOMAH (ORCPT + 99 others); Wed, 15 Apr 2020 08:00:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:35730 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368070AbgDOMAF (ORCPT ); Wed, 15 Apr 2020 08:00:05 -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 DE4A5AF10; Wed, 15 Apr 2020 12:00:01 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 362FF1E1250; Wed, 15 Apr 2020 14:00:02 +0200 (CEST) Date: Wed, 15 Apr 2020 14:00:02 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-kernel@vger.kernel.org, Jan Kara , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC 2/8] fs/ext4: Disallow verity if inode is DAX Message-ID: <20200415120002.GE6126@quack2.suse.cz> References: <20200414040030.1802884-1-ira.weiny@intel.com> <20200414040030.1802884-3-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200414040030.1802884-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 Mon 13-04-20 21:00:24, 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 > --- > fs/ext4/verity.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c > index dc5ec724d889..ce3f9a198d3b 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 (WARN_ON_ONCE(IS_DAX(inode))) > + return -EINVAL; > + Hum, one question, is there a reason for WARN_ON_ONCE()? If I understand correctly, user could normally trigger this, couldn't he? Honza > if (ext4_verity_in_progress(inode)) > return -EBUSY; > > -- > 2.25.1 > -- Jan Kara SUSE Labs, CR