Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp4949130lkq; Thu, 10 Dec 2020 12:52:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoLicJfcZaCJI5ipajRgyayiJ7HX5/DyiIp6NJx0yPKi4McgW27OJHUUiWfK12fx6Uz4u8 X-Received: by 2002:a17:906:cec3:: with SMTP id si3mr8062737ejb.277.1607633574101; Thu, 10 Dec 2020 12:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607633574; cv=none; d=google.com; s=arc-20160816; b=psn4MORqP6gxfBMkI3W0ZIKrJpg07RUFQqRouJQ8l9nUOO+vyLYrDX82oHCCZoq5RH y9JMSVL8dghxUBlyqUTSK5SQ2gszwujUT2oVOkMZ/oV7YmQdCizcKshP0NMWfIpXkr6D ThLOIFeDDQnLZEKggAYn4j+NCcJb7JXVhvspwPHqo31CYoT4UE545PXRTLFk6FXQMPDD trTQ4mzB3+kiVkCKteQpXtERu7lxVSsn/De31hCNdjTfKjYBnezgu4mwa+QlBT0xILYg k0fjUSzjnqqUS7rqRj47qtotUF9gVWmPfWmQfV1EqtmyP/t/aaK3ecjUVxpb5ylvOpi5 F+Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=5gRzJsodGJyrUD9n6fFWGxcqO7D/+oNZZ+s+UiRS2OQ=; b=SlwS+KVL3QSU38BRCTDMsxrCDbgd7EP4eFG6cK9kCnqLeRbQcuplhBYHy1FYnfW0kM 41/OON/Pk2s2tXO1cx8h1fRS/77PUfja5Q2bydjsOBM3oTQuC4jDn9/7otDrR5Wt2v6H riTE1tD4R9uSNVwiEVpWPN1OdciPD9MX39htAESh0ROpcXhlRj5QGPndIcniGo7qyYa5 nhR5mXfPL+i2+5ZFBUgpUy541REkzHmVS0adHrA3XXIN3UA3KjeOHfsG5pMEB0XxxgiJ LXhHj5fwzGdFCz0eZ90axgdZ/+D4P2E332k6XymhfdF9ilMftmJjfWqB79FNVGlxi+Hz QR2A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si3398195ejt.198.2020.12.10.12.52.17; Thu, 10 Dec 2020 12:52:54 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgLJUt6 (ORCPT + 99 others); Thu, 10 Dec 2020 15:49:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404508AbgLJUtp (ORCPT ); Thu, 10 Dec 2020 15:49:45 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0EC8C0613CF for ; Thu, 10 Dec 2020 12:49:04 -0800 (PST) Received: from localhost (unknown [IPv6:2804:14c:132:242d::1000]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 11F221F448A4; Thu, 10 Dec 2020 20:49:02 +0000 (GMT) From: Gabriel Krisman Bertazi To: Arnaud Ferraris Cc: linux-ext4@vger.kernel.org, drosen@google.com, ebiggers@kernel.org, tytso@mit.edu Subject: Re: [PATCH RESEND v2 10/12] e2fsck: Add option to force encoded filename verification Organization: Collabora References: <20201210150353.91843-1-arnaud.ferraris@collabora.com> <20201210150353.91843-11-arnaud.ferraris@collabora.com> Date: Thu, 10 Dec 2020 17:48:57 -0300 In-Reply-To: <20201210150353.91843-11-arnaud.ferraris@collabora.com> (Arnaud Ferraris's message of "Thu, 10 Dec 2020 16:03:51 +0100") Message-ID: <877dpp2xqe.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Arnaud Ferraris writes: > From: Gabriel Krisman Bertazi > > This is interesting for !strict filesystems as part of the encoding > update procedure. Once the filesystem is known to not have badly encoded > filenames, the update is trivial, thanks to the stability of assigned > code points in the unicode specification. Ted, I thought of this after your comment on LSFMM 2019 that strict mode made the update of the unicode version trivial. I think this patch is a dependency for ext4 to support a newer unicode version, which I'd like to support in the near feature, such that we don't lag too much behind the Unicode specification. > > Signed-off-by: Gabriel Krisman Bertazi > Signed-off-by: Arnaud Ferraris > --- > e2fsck/e2fsck.h | 1 + > e2fsck/pass2.c | 5 +++-- > e2fsck/unix.c | 4 ++++ > 3 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h > index dcaab0a1..f324e92c 100644 > --- a/e2fsck/e2fsck.h > +++ b/e2fsck/e2fsck.h > @@ -177,6 +177,7 @@ struct resource_track { > #define E2F_OPT_ICOUNT_FULLMAP 0x20000 /* use an array for inode counts */ > #define E2F_OPT_UNSHARE_BLOCKS 0x40000 > #define E2F_OPT_CLEAR_UNINIT 0x80000 /* Hack to clear the uninit bit */ > +#define E2F_OPT_CHECK_ENCODING 0x100000 /* Force verification of encoded filenames */ > > /* > * E2fsck flags > diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c > index b6514de8..f93e2b53 100644 > --- a/e2fsck/pass2.c > +++ b/e2fsck/pass2.c > @@ -1049,9 +1049,10 @@ static int check_dir_block(ext2_filsys fs, > ctx = cd->ctx; > > /* We only want filename encoding verification on strict > - * mode. */ > + * mode or if explicitly requested by user. */ > if (ext2fs_test_inode_bitmap2(ctx->inode_casefold_map, ino) && > - (ctx->fs->super->s_encoding_flags & EXT4_ENC_STRICT_MODE_FL)) > + ((ctx->fs->super->s_encoding_flags & EXT4_ENC_STRICT_MODE_FL) || > + (ctx->options & E2F_OPT_CHECK_ENCODING))) > cf_dir = 1; > > if (ctx->flags & E2F_FLAG_RUN_RETURN) > diff --git a/e2fsck/unix.c b/e2fsck/unix.c > index 1cb51672..0a9012e5 100644 > --- a/e2fsck/unix.c > +++ b/e2fsck/unix.c > @@ -753,6 +753,9 @@ static void parse_extended_opts(e2fsck_t ctx, const char *opts) > ctx->options |= E2F_OPT_UNSHARE_BLOCKS; > ctx->options |= E2F_OPT_FORCE; > continue; > + } else if (strcmp(token, "check_encoding") == 0) { > + ctx->options |= E2F_OPT_CHECK_ENCODING; > + continue; > #ifdef CONFIG_DEVELOPER_FEATURES > } else if (strcmp(token, "clear_all_uninit_bits") == 0) { > ctx->options |= E2F_OPT_CLEAR_UNINIT; > @@ -784,6 +787,7 @@ static void parse_extended_opts(e2fsck_t ctx, const char *opts) > fputs("\tbmap2extent\n", stderr); > fputs("\tunshare_blocks\n", stderr); > fputs("\tfixes_only\n", stderr); > + fputs("\tcheck_encoding\n", stderr); > fputc('\n', stderr); > exit(1); > } -- Gabriel Krisman Bertazi