Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3541315pxu; Tue, 15 Dec 2020 09:18:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxasJjkD4pV+icvgRBPjkB7AJBx+fx5oXYNaOsRV09day4NAgHJBffRFm6y9712HqAPspOw X-Received: by 2002:a17:906:b309:: with SMTP id n9mr5580877ejz.365.1608052708553; Tue, 15 Dec 2020 09:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608052708; cv=none; d=google.com; s=arc-20160816; b=iSwG3SUgfavCH0MBVYNbexVCwsaBMBckUvDUOWYSfcuDkPTuCR9GodGjaGCZPcQn1D R7qBTkiTGmdlOkdTU45LGZpcEEG/LoA6f263Wu9LzXY4SzZeCZIqWllyWSFd5Z288a3E P4DGkys1Y5MmcPB4bvoOn7YHICZCDyVP+CP91G+9fOvkdj0gPasaMtPNclceRGVeJuGn G8tBX6bdhGv4Kccn/CIKC/ND7UJ8cfMk9WpzgX9kgs4SZXwHtsf5MGaGz0tQeGJ+u4fm IcYbajSClfy8z/t8CCMOa7vKj0qmwDO+yfxSuIrkOXE4q7I+kfjTpZaG8gU5TkhUWgC4 12lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=r//8tLf04cNnZiyf6qz31s68oNxy+3kQdUdRSTcTPH0=; b=blKdYd4EW4gb45l4ake8Jcql3r36+8qMyT5MGtGD1vgyEL4qTwlrRyt5RUlhrETsDF pR7wqO57EI3GDS+FVNINFFNhlEWtLYGL/dnoiCr7Rg+i/1NwCndb4FoOmtLrIaSFvSLV wcj+SjdF8iqaSE2Jkp0LusjYNquLQn1LSM1y+jS7AJ3tVzWosuK/CA5SNFrFOl0w5dU0 8BCncOLR32igh+Oqpubhga9ZuW0dSSSb0OjvI41JuU/vPs/5H2/byTWi/ZYr5y0ahHeN +F6XohM5pKCMH5LhopDqWW30iqRLrXZ1hrNzWEyPIGfgbn1yQ9DkG0lPFRfsRtqBpXm6 2yhg== 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 s10si1217650ejb.154.2020.12.15.09.17.53; Tue, 15 Dec 2020 09:18:28 -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 S1729028AbgLORRg (ORCPT + 99 others); Tue, 15 Dec 2020 12:17:36 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55068 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729969AbgLORRa (ORCPT ); Tue, 15 Dec 2020 12:17:30 -0500 Received: from [IPv6:2a01:e35:2fb5:1510:37ed:2c43:5fa2:bd48] (unknown [IPv6:2a01:e35:2fb5:1510:37ed:2c43:5fa2:bd48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aferraris) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 51DB61F454A0; Tue, 15 Dec 2020 17:16:48 +0000 (GMT) Subject: Re: [PATCH RESEND v2 06/12] e2fsck: Fix entries with invalid encoded characters To: Gabriel Krisman Bertazi Cc: linux-ext4@vger.kernel.org, drosen@google.com, ebiggers@kernel.org, tytso@mit.edu References: <20201210150353.91843-1-arnaud.ferraris@collabora.com> <20201210150353.91843-7-arnaud.ferraris@collabora.com> <87360d2xm9.fsf@collabora.com> From: Arnaud Ferraris Message-ID: Date: Tue, 15 Dec 2020 18:16:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <87360d2xm9.fsf@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Gabriel, Le 10/12/2020 à 21:51, Gabriel Krisman Bertazi a écrit : > Arnaud Ferraris writes: > >> From: Gabriel Krisman Bertazi >> >> @@ -1483,11 +1520,7 @@ skip_checksum: >> if (check_filetype(ctx, dirent, ino, &cd->pctx)) >> dir_modified++; >> >> - if (dir_encpolicy_id == NO_ENCRYPTION_POLICY) { >> - /* Unencrypted directory */ >> - if (check_name(ctx, dirent, &cd->pctx)) >> - dir_modified++; >> - } else { >> + if (dir_encpolicy_id != NO_ENCRYPTION_POLICY) { >> /* Encrypted directory */ >> if (dot_state > 1 && >> check_encrypted_dirent(ctx, dirent, >> @@ -1497,6 +1530,14 @@ skip_checksum: >> dir_modified++; >> goto next; >> } >> + } else if (cf_dir) { >> + /* Casefolded directory */ >> + if (encoded_check_name(ctx, dirent, &cd->pctx)) >> + dir_modified++; >> + } else { >> + /* Unencrypted and uncasefolded directory */ >> + if (check_name(ctx, dirent, &cd->pctx)) >> + dir_modified++; >> } > > This won't do for encrypted+casefolded directories, right? Indeed, as encrypted+casefolded isn't supported right now, it's just a re-arrangement to ease future support, as suggested by Eric. Arnaud > >> >> if (dx_db) { >