Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp765795ybz; Wed, 15 Apr 2020 18:30:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLKBAWMCPWgCs2vNODH1optCxpdG0or4eM15V9/t9s2xJSaDGOB/xIuoklUm+LwOjlga3nm X-Received: by 2002:aa7:cac6:: with SMTP id l6mr27918943edt.265.1587000601361; Wed, 15 Apr 2020 18:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587000601; cv=none; d=google.com; s=arc-20160816; b=fp7Dcc0Io6oXfqnDRAVIrjGlGzaHhfJFQTOJUSUq6tidkJA9Bq3SLMSlSxJBGHSfFG PRQzk6+fypH6ivNIcDFrng9l8v3vIwOzyC5bO7IemFL1EUvMkvRG/kPkWtKhTwnE+tAn lxInqn1JZJGDzskU33GDzEj//yWT9XHXrGHYKc+PEXyQTA8eqz4MQYZpWmfY4tI05Ki4 E3Aq+ppvnWmSRHXTUlnEFW158VbTb7lM27myq2BY62IQH3igHVvCGt31Q8ITiPtoBs9z Lrf3u71mYCqeSF9FMzdsv1h3n6/7RIqwhfh9qHVAIGRnAMVHgK3dmzlCSlXLXaD36u+s 4kcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JNhfclZvE2IS/XyGTCWwSkoIvg5BJSWLO/JSSPeu/fY=; b=vtX1SDkObtzcn0y45lFNoCiAlrvDgqyUznH4/0Djzk/GtC9mvJWGu+v78lPZb9L0Bp eEC6i7KNBjax5oFwKUTEBNq942ysNV1RSATx0kYoUWnPGANHxq/+mMUcGegxVYtzrpcB qwn2XVUp7PjOaCX+V3vN3hdC1ioSqyzp8RB/uF4j7OfYBMsP0RTtDOSoU4R8oKocui9p sXzCT7fDHarIAUhr+LU/eeaYF2+VwxJ1SZhGB5fum+bCrPPCj9grCQ0IeyiPVkLTSYXf lki2gr/cy6TSUN/bHR5rNaaRC+CrN0Me6pxwWFamjhj8CHJZT61JYQJAW5FgMi7ioTy7 9D7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U7Apg3Pr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si7609644edq.393.2020.04.15.18.29.33; Wed, 15 Apr 2020 18:30:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=U7Apg3Pr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732679AbgDPB3I (ORCPT + 99 others); Wed, 15 Apr 2020 21:29:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:40696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732522AbgDPB3E (ORCPT ); Wed, 15 Apr 2020 21:29:04 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (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 1CBC7208E0; Thu, 16 Apr 2020 01:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587000543; bh=hq/+bVXnleESn8mSlWiIeOiFdqP5VlQ1XkbPhFhBPAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U7Apg3PrInj1bZ5S36DCxeG04p3aKJHJiJwrLO/6Ve1tvjwUnZziTJm8y1phI+4Gq qj09WXqwTPZmoyuQl/UvHjdW2KG4XibW7wv0YzFOJQw378Na5/IhOsJJS4CJTq+Shr P3ndXnQ/1SyJbLjFawUAT8sTOdLs7Go1HtB9nKKE= Date: Wed, 15 Apr 2020 18:29:01 -0700 From: Eric Biggers To: Ira Weiny Cc: Jan Kara , linux-kernel@vger.kernel.org, "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: <20200416012901.GA816@sol.localdomain> References: <20200414040030.1802884-1-ira.weiny@intel.com> <20200414040030.1802884-3-ira.weiny@intel.com> <20200415120002.GE6126@quack2.suse.cz> <20200415191451.GA2305801@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415191451.GA2305801@iweiny-DESK2.sc.intel.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 15, 2020 at 12:14:52PM -0700, Ira Weiny wrote: > On Wed, Apr 15, 2020 at 02:00:02PM +0200, Jan Kara wrote: > > 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? > > Ok. I did not think this through but I did think about this. I was following > the code from the encryption side which issues a warning and was thinking that > would be a good way to alert the user they are doing something wrong... > > I think you are right about both of them but we also need to put something in > the verity, dax, and ... (I can't find a file in Documentation which talks > about encryption right off) documentation files.... For verity something like. > > > Verity and DAX > -------------- > > Verity and DAX are not compatible and attempts to set both of these flags on a > file will fail. > > > And the same thing in the DAX doc? > > And where would be appropriate for the encrypt doc? > Documentation/filesystems/fscrypt.rst mentions that DAX isn't supported on encrypted files, but it doesn't say what happens if someone tries to do it anyway. Feel free to improve the documentation. - Eric