Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1007215ybl; Wed, 21 Aug 2019 08:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5CIOt2m4jRdFztydOHVo1pyy/f7/hFxnHTzjzTaFif3iz/KGpyDznW1wsvLQAbS6N/0d9 X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr34522772plb.283.1566402275813; Wed, 21 Aug 2019 08:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566402275; cv=none; d=google.com; s=arc-20160816; b=VfyKStCVY1MTSgcvwQLObEv5GvQDGbUIlX8tzXir7fBNpAkKWgb9DYq01r5LkBnfSy 1C7muAzhO+5S56DOXwpfJ99NdJwkK4v1LL5SiNXNyRLR8cfaPQEd4bAR+I4pJogPJfRN 6209V7Wv33DhKcQQ8VLNVD6Dt48XdCXK+mgNUmaeeNvL/uLg5RbED/Hurx6fstSpLmVo L/6qgU/7aSGFSB3HMo1B9yfX+q4UQ0YnJulIjwpR34f8Uei9AmS05aL/e3m5Gzmx9XVu CMJVY+7KAZuSr+xyvJiZLPVKhNOIvOoR3HKZpMdjW5EkwocU9k1E9wnjg5654Xz1B0gZ UJ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject:reply-to; bh=c3/DZ2dN/BdfI161UKwjxbv1g8S/E7h7gEL9ZJSAtcM=; b=PBjP7sPRsjvEgx7DrM+XEgiEflHklHSfwAPZAlMhjetvhoXtNH0x3m5pHBU5hKJq0F FBPb++ZfMZRFm0MxR6RQ/+n7ho5iHtHYc241kttT5zP6MazzScXfclcLcl5wOCHX6wBO QtCYKjR1vgssICDS+r1neTGCiK5aPgIAZfK7VvyBEfflBCc0tdARuoS172BOfhrXnMKM nof+sB0AP85oJonj1oK5Fhj7s5xpqCjuJQJsc+hrmcSieFStrXo8/vtTQdwwXoSR3br/ SPFo9PfTmxYuKvnEx3ZHA3p4pkrZ1pcOILjVKQMDBDXJtYwbVH3LcrBvYbwzXNqyIwai E7mQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si15066524plp.182.2019.08.21.08.44.22; Wed, 21 Aug 2019 08:44:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727874AbfHUPTO (ORCPT + 99 others); Wed, 21 Aug 2019 11:19:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53448 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727683AbfHUPTO (ORCPT ); Wed, 21 Aug 2019 11:19:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12B2B3083362 for ; Wed, 21 Aug 2019 15:19:14 +0000 (UTC) Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0690381A7; Wed, 21 Aug 2019 15:19:13 +0000 (UTC) Reply-To: sandeen@redhat.com Subject: Re: [PATCH 1/2] mke2fs: Warn if page size != blocksize when ecnrypt is enabled To: Lukas Czerner , linux-ext4@vger.kernel.org References: <20190821131813.9456-1-lczerner@redhat.com> From: Eric Sandeen Openpgp: preference=signencrypt Autocrypt: addr=esandeen@redhat.com; prefer-encrypt=mutual; keydata= mQINBE6x99QBEADMR+yNFBc1Y5avoUhzI/sdR9ANwznsNpiCtZlaO4pIWvqQJCjBzp96cpCs nQZV32nqJBYnDpBDITBqTa/EF+IrHx8gKq8TaSBLHUq2ju2gJJLfBoL7V3807PQcI18YzkF+ WL05ODFQ2cemDhx5uLghHEeOxuGj+1AI+kh/FCzMedHc6k87Yu2ZuaWF+Gh1W2ix6hikRJmQ vj5BEeAx7xKkyBhzdbNIbbjV/iGi9b26B/dNcyd5w2My2gxMtxaiP7q5b6GM2rsQklHP8FtW ZiYO7jsg/qIppR1C6Zr5jK1GQlMUIclYFeBbKggJ9mSwXJH7MIftilGQ8KDvNuV5AbkronGC sEEHj2khs7GfVv4pmUUHf1MRIvV0x3WJkpmhuZaYg8AdJlyGKgp+TQ7B+wCjNTdVqMI1vDk2 BS6Rg851ay7AypbCPx2w4d8jIkQEgNjACHVDU89PNKAjScK1aTnW+HNUqg9BliCvuX5g4z2j gJBs57loTWAGe2Ve3cMy3VoQ40Wt3yKK0Eno8jfgzgb48wyycINZgnseMRhxc2c8hd51tftK LKhPj4c7uqjnBjrgOVaVBupGUmvLiePlnW56zJZ51BR5igWnILeOJ1ZIcf7KsaHyE6B1mG+X dmYtjDhjf3NAcoBWJuj8euxMB6TcQN2MrSXy5wSKaw40evooGwARAQABtCVFcmljIFIuIFNh bmRlZW4gPHNhbmRlZW5Ac2FuZGVlbi5uZXQ+iQI7BBMBAgAlAhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgAUCUzMzbAIZAQAKCRAgrhaS4T3e4Fr7D/wO+fenqVvHjq21SCjDCrt8HdVj aJ28B1SqSU2toxyg5I160GllAxEHpLFGd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SlkblXRMK87iLYQSrcV6cFz9PRl4vW1LGff3xRQHngeN5fPx ze8X5NE3hb+SSwyMSEqJxhVTXJVfQWWW0dQxP7HNwqmOWYF/6m+1gK/Y2gY3jAQnsWTru4RV TZGnKwEPmOCpSUvsTRXsVHgsWJ70qd0yOSjWuiv4b8vmD3+QFgyvCBxPMdP3xsxN5etheLMO gRwWpLn6yNFq/xtgs+ECgG+gR78yXQyA7iCs5tFs2OrMqV5juSMGmn0kxJUAEQEAAYkCHwQY AQIACQUCTrH31AIbDAAKCRAgrhaS4T3e4BKwD/0ZOOmUNOZCSOLAMjZx3mtYtjYgfUNKi0ki YPveGoRWTqbis8UitPtNrG4XxgzLOijSdOEzQwkdOIp/QnZhGNssMejCnsluK0GQd+RkFVWN mcQT78hBeGcnEMAXZKq7bkIKzvc06GFmkMbX/gAl6DiNGv0UNAX+5FYh+ucCJZSyAp3sA+9/ LKjxnTedX0aygXA6rkpX0Y0FvN/9dfm47+LGq7WAqBOyYTU3E6/+Z72bZoG/cG7ANLxcPool LOrU43oqFnD8QwcN56y4VfFj3/jDF2MX3xu4v2OjglVjMEYHTCxP3mpxesGHuqOit/FR+mF0 MP9JGfj6x+bj/9JMBtCW1bY/aPeMdPGTJvXjGtOVYblGZrSjXRn5++Uuy36CvkcrjuziSDG+ JEexGxczWwN4mrOQWhMT5Jyb+18CO+CWxJfHaYXiLEW7dI1AynL4jjn4W0MSiXpWDUw+fsBO Pk6ah10C4+R1Jc7dyUsKksMfvvhRX1hTIXhth85H16706bneTayZBhlZ/hK18uqTX+s0onG/ m1F3vYvdlE4p2ts1mmixMF7KajN9/E5RQtiSArvKTbfsB6Two4MthIuLuf+M0mI4gPl9SPlf fWCYVPhaU9o83y1KFbD/+lh1pjP7bEu/YudBvz7F2Myjh4/9GUAijrCTNeDTDAgvIJDjXuLX pA== Message-ID: <30492603-86b4-8ea4-4573-6c2c4db12237@redhat.com> Date: Wed, 21 Aug 2019 10:19:12 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190821131813.9456-1-lczerner@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Aug 2019 15:19:14 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 8/21/19 8:18 AM, Lukas Czerner wrote: > With encrypt feature enabled the file system block size must match > system page size. Currently mke2fs will not complain at all when we try > to create a file system that does not satisfy this requirement for the > system. Add a warning for this case. > > Signed-off-by: Lukas Czerner This matches the warnings we give for block size > system page size, for example, so this makes sense to me. Reviewed-by: Eric Sandeen > --- > misc/mke2fs.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/misc/mke2fs.c b/misc/mke2fs.c > index d7cf257e..aa9590d8 100644 > --- a/misc/mke2fs.c > +++ b/misc/mke2fs.c > @@ -2468,6 +2468,26 @@ profile_error: > exit (1); > } > > + /* > + * Encrypt feature requires blocksize to be the same as page size, > + * otherwise file system won't mount > + */ > + if (ext2fs_has_feature_encrypt(&fs_param) && > + (blocksize != sys_page_size)) { > + if (!force) { > + com_err(program_name, 0, > + _("Encrypt feature is enabled, but block size " > + "(%dB) does not match system page size " > + "(%dB)"), > + blocksize, sys_page_size); > + proceed_question(proceed_delay); > + } > + fprintf(stderr,_("Warning: Encrypt feature enabled, but block " > + "size (%dB) does not match system page size " > + "(%dB), forced to continue\n"), > + blocksize, sys_page_size); > + } > + > /* Don't allow user to set both metadata_csum and uninit_bg bits. */ > if (ext2fs_has_feature_metadata_csum(&fs_param) && > ext2fs_has_feature_gdt_csum(&fs_param)) >