Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2993401ybk; Mon, 18 May 2020 13:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZVmg9cWy06kTYMyov8aptgEVFkMHxZB8ZWgqh2zry0s5UC4JYtgK+TD+IkKJWhNKHL04K X-Received: by 2002:a17:906:a1da:: with SMTP id bx26mr16132874ejb.42.1589832238048; Mon, 18 May 2020 13:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589832238; cv=none; d=google.com; s=arc-20160816; b=dGlNffr/l0wqaO7JH5JP95GSUAok0ixHsVcklF651n+Wg3H0nbYJ27DzzYHWnXam5p MflJmbPFLmWdLZV6LLnQIeaBuxEnISfmVOE+D4TOs7Ye6oA4an3AcS2c/pKTI7MzeKwF 0qkch5HOTPB2Nrs1/LrPm5nxZ9SxWb8NDg72fdvJR1ltVIe6GUqQyrdALHujEJ9c4YfD L+AKN7u6yl+UaQyDLQcPHAUnQ+hCCkZxgXoasZho5DFwvuOSQWEcf3PBCRy59/VksLMO xEnEsHa1AAQqeT1XoRx1wKhHpsMmDsGRGnXGlkijwb/f1s4EaX1IFwnxfEkFo9dh/wA+ 0jNQ== 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=7a+M+7qBqX4cj1J0p23d8zU87HbsoiN3QaIFmVfVLjU=; b=PbdT5gSB2zGtjLrZfNNbMGjOiaQgano8wBt7dSTQ6/DGZOAkgztkKZBkQwLA/dGSQr ycO76lszdmRlVMiaC6T/vwa7Ivrvg2V1qLjo7U0LrM98Qk5TPoN+2qFBdRJoXq5fnYzY RSHQkkrzby338myLkNJENHFImDJZfUOx5BSZfsLmAiPm9DLwbfRctdmFj0P2v1OkYRKx uJW4YBLJZlhaHkGmYworPn0xiVfME41eel3UlQFDby02Dwj+dyv94yCGiS4X1vV/twan b9xAaNhRWyg6y/3Y4jOP8iReQNhBtJLz8oIo4HgwAtZ2CqRD+JEZUgyRBeCc4obCcz91 0Nag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SblDj+20; 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 ci18si3346128ejc.205.2020.05.18.13.03.23; Mon, 18 May 2020 13:03:58 -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=SblDj+20; 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 S1728389AbgERTod (ORCPT + 99 others); Mon, 18 May 2020 15:44:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbgERTod (ORCPT ); Mon, 18 May 2020 15:44:33 -0400 Received: from gmail.com (unknown [104.132.1.76]) (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 95188207F5; Mon, 18 May 2020 19:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589831073; bh=oy9YnKVQd9UwRnc0AtIyh15UtZegjDULjfw6/wLKXW8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SblDj+20WmoadkylWzDlhSuXFLQFYLblQPumAF+SNiOzE+jUzPscJBuBMJbnCE8mD lGz3g4eitY2LWDyGlkH81wxuPMztTxhLxKfRPqPfCUT3Le8PYk0rY8UCnkpOyKDRU0 scWVGb1emwQ9G2B0TUrFPeoK822n+eyzHxCy3Qvg= Date: Mon, 18 May 2020 12:44:31 -0700 From: Eric Biggers To: Ira Weiny 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 3/9] fs/ext4: Disallow encryption if inode is DAX Message-ID: <20200518194431.GB121709@gmail.com> References: <20200513054324.2138483-1-ira.weiny@intel.com> <20200513054324.2138483-4-ira.weiny@intel.com> <20200516020253.GG1009@sol.localdomain> <20200518050315.GA3025231@iweiny-DESK2.sc.intel.com> <20200518162447.GA954@sol.localdomain> <20200518192357.GE3025231@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200518192357.GE3025231@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 Mon, May 18, 2020 at 12:23:57PM -0700, Ira Weiny wrote: > > > > The other question is what should happen when a file is created in an encrypted > > directory when the filesystem is mounted with -o dax. Actually, I think I > > missed something there. Currently (based on reading the code) the DAX flag will > > get set first, and then ext4_set_context() > > See this is where I am confused. Above you said that ext4_set_context() is only > called on a directory. And I agree with you now having seen the check in > fscrypt_ioctl_set_policy(). So what is the call path you are speaking of here? Here's what I actually said: ext4_set_context() is only called when FS_IOC_SET_ENCRYPTION_POLICY sets an encryption policy on an empty directory, *or* when a new inode (regular, dir, or symlink) is created in an encrypted directory (thus inheriting encryption from its parent). Just find the places where ->set_context() is called and follow them backwards. - Eric