From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE727C10F26 for ; Sat, 7 Mar 2020 03:49:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B65862073C for ; Sat, 7 Mar 2020 03:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgCGDs5 (ORCPT ); Fri, 6 Mar 2020 22:48:57 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:43782 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726769AbgCGDs5 (ORCPT ); Fri, 6 Mar 2020 22:48:57 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAQSI-006ea4-7q; Sat, 07 Mar 2020 03:48:50 +0000 Date: Sat, 7 Mar 2020 03:48:50 +0000 From: Al Viro To: Daniel Rosenberg Cc: Theodore Ts'o , linux-ext4@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, Richard Weinberger , linux-mtd@lists.infradead.org, Andreas Dilger , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi , kernel-team@android.com Subject: Re: [PATCH v8 2/8] fs: Add standard casefolding support Message-ID: <20200307034850.GH23230@ZenIV.linux.org.uk> References: <20200307023611.204708-1-drosen@google.com> <20200307023611.204708-3-drosen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200307023611.204708-3-drosen@google.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Mar 06, 2020 at 06:36:05PM -0800, Daniel Rosenberg wrote: > +/** > + * generic_ci_d_hash - generic implementation of d_hash for casefolding > + * @dentry: Entry whose name we are hashing > + * @len: length of str > + * @qstr: name of the dentry, safely paired with len > + * @str: qstr to set hash of > + * > + * This performs a case insensitive hash of the given str. > + * If casefolding is not required, it leaves the hash unchanged. > + */ > +int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str) > +{ > + const struct inode *inode = READ_ONCE(dentry->d_inode); > + struct super_block *sb = dentry->d_sb; > + const struct unicode_map *um = sb->s_encoding; > + char small_name[DNAME_INLINE_LEN]; > + struct qstr entry = QSTR_INIT(str->name, str->len); > + int ret = 0; > + > + if (!inode || !needs_casefold(inode)) > + return 0; > + > + if (make_name_stable(um, dentry, &entry, small_name)) > + goto err; > + ret = utf8_casefold_hash(um, dentry, &entry); > + if (ret < 0) > + goto err; > + > + return 0; > +err: > + if (sb_has_enc_strict_mode(sb)) > + ret = -EINVAL; > + else > + ret = 0; > + return ret; > +} Have you even tested that? Could you tell me where does the calculated hash go? And just what is it doing trying to check if the name we are about to look up in directory specified by 'dentry' might be pointing to dentry->d_iname? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5304CC10F00 for ; Sat, 7 Mar 2020 03:49:11 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2096D2072D for ; Sat, 7 Mar 2020 03:49:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="OZKnMrZm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="Uhr18a9C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2096D2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jAQSc-00061y-IF; Sat, 07 Mar 2020 03:49:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jAQSb-00061X-7z for linux-f2fs-devel@lists.sourceforge.net; Sat, 07 Mar 2020 03:49:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Sender:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PavVmBy5q1Ud2VcUriOj6uqcJWuap1YNtqtI2Ea6UYk=; b=OZKnMrZmsRq4n340WsxFltNZA csLi1hLKSIbWM0SqhcS/2HlFT/QUIp+jL7tnHWvGLx9PefZZV3l/2xcV88DDPGPO1sMYzxjXfohVj +bhuCp+Oe/XhHgxMcfXBFYyLWEhZOAdPYPscMgupaNmx6/YeMob96wH3fdVuN8xu/2TAQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PavVmBy5q1Ud2VcUriOj6uqcJWuap1YNtqtI2Ea6UYk=; b=Uhr18a9CotSdz52WRYZ0tFt+IG 0Ht/vO6ZlugrIyoOzuHmpOM/d48kBsBjwAnvTQctYeO6rF3kHDx0JJgUstg2IqOBfxrJZbh9uI6cM SWT0R7DmU3RvhOeMLXWf+YOsUf+OOQEaltRyZPeMi1u2oYgg1MwxG3LKRflmkSvXsKsY=; Received: from zeniv.linux.org.uk ([195.92.253.2]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jAQSW-000vNJ-Bl for linux-f2fs-devel@lists.sourceforge.net; Sat, 07 Mar 2020 03:49:09 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAQSI-006ea4-7q; Sat, 07 Mar 2020 03:48:50 +0000 Date: Sat, 7 Mar 2020 03:48:50 +0000 From: Al Viro To: Daniel Rosenberg Message-ID: <20200307034850.GH23230@ZenIV.linux.org.uk> References: <20200307023611.204708-1-drosen@google.com> <20200307023611.204708-3-drosen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200307023611.204708-3-drosen@google.com> X-Headers-End: 1jAQSW-000vNJ-Bl Subject: Re: [f2fs-dev] [PATCH v8 2/8] fs: Add standard casefolding support X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, Theodore Ts'o , Jonathan Corbet , Richard Weinberger , Andreas Dilger , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, Mar 06, 2020 at 06:36:05PM -0800, Daniel Rosenberg wrote: > +/** > + * generic_ci_d_hash - generic implementation of d_hash for casefolding > + * @dentry: Entry whose name we are hashing > + * @len: length of str > + * @qstr: name of the dentry, safely paired with len > + * @str: qstr to set hash of > + * > + * This performs a case insensitive hash of the given str. > + * If casefolding is not required, it leaves the hash unchanged. > + */ > +int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str) > +{ > + const struct inode *inode = READ_ONCE(dentry->d_inode); > + struct super_block *sb = dentry->d_sb; > + const struct unicode_map *um = sb->s_encoding; > + char small_name[DNAME_INLINE_LEN]; > + struct qstr entry = QSTR_INIT(str->name, str->len); > + int ret = 0; > + > + if (!inode || !needs_casefold(inode)) > + return 0; > + > + if (make_name_stable(um, dentry, &entry, small_name)) > + goto err; > + ret = utf8_casefold_hash(um, dentry, &entry); > + if (ret < 0) > + goto err; > + > + return 0; > +err: > + if (sb_has_enc_strict_mode(sb)) > + ret = -EINVAL; > + else > + ret = 0; > + return ret; > +} Have you even tested that? Could you tell me where does the calculated hash go? And just what is it doing trying to check if the name we are about to look up in directory specified by 'dentry' might be pointing to dentry->d_iname? _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 274E2C10F00 for ; Sat, 7 Mar 2020 03:51:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E661D206D7 for ; Sat, 7 Mar 2020 03:51:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CdE0wVlh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E661D206D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=31Z0woKaI8qd76tCzILUrykE3oYEP6OJlCCgAGgLCKo=; b=CdE0wVlhtrAqVc 8ia4BQBdO09mf/AIAJlIsjdZ4hn4zm2wLHb5vpR0AUb3Efv1OB6dGPcxqPnLfX1H4cozA6ytTZhmJ HhIzIeSjpNgcBCf15DaLtPhNWmGYo8jNLVdmrz7PWk6JD7lfmVo0EV+VHh1+pGxN6oM10qkan9kmr +NaVMz0RTXidzlIUEiP0knJVXLf2iyaxkSz5XxcV+g9ed4g9Zn59N7Eku+e94Bc9FBVEJN/x8VbYq KOYhNqokmHjf+YHXaWutWiOhgz86qZkk2x4H64ibnvkQMYCt30J9yC7FTHgg5Xzjbu6D5kNPwIsSH jwW6/kBboBdbYf4US2Ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAQUd-0000S2-GQ; Sat, 07 Mar 2020 03:51:15 +0000 Received: from zeniv.linux.org.uk ([195.92.253.2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAQUX-0007cL-Ng for linux-mtd@lists.infradead.org; Sat, 07 Mar 2020 03:51:11 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAQSI-006ea4-7q; Sat, 07 Mar 2020 03:48:50 +0000 Date: Sat, 7 Mar 2020 03:48:50 +0000 From: Al Viro To: Daniel Rosenberg Subject: Re: [PATCH v8 2/8] fs: Add standard casefolding support Message-ID: <20200307034850.GH23230@ZenIV.linux.org.uk> References: <20200307023611.204708-1-drosen@google.com> <20200307023611.204708-3-drosen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200307023611.204708-3-drosen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_195109_772183_523AE92A X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, Theodore Ts'o , Jonathan Corbet , Richard Weinberger , Andreas Dilger , Chao Yu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Fri, Mar 06, 2020 at 06:36:05PM -0800, Daniel Rosenberg wrote: > +/** > + * generic_ci_d_hash - generic implementation of d_hash for casefolding > + * @dentry: Entry whose name we are hashing > + * @len: length of str > + * @qstr: name of the dentry, safely paired with len > + * @str: qstr to set hash of > + * > + * This performs a case insensitive hash of the given str. > + * If casefolding is not required, it leaves the hash unchanged. > + */ > +int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str) > +{ > + const struct inode *inode = READ_ONCE(dentry->d_inode); > + struct super_block *sb = dentry->d_sb; > + const struct unicode_map *um = sb->s_encoding; > + char small_name[DNAME_INLINE_LEN]; > + struct qstr entry = QSTR_INIT(str->name, str->len); > + int ret = 0; > + > + if (!inode || !needs_casefold(inode)) > + return 0; > + > + if (make_name_stable(um, dentry, &entry, small_name)) > + goto err; > + ret = utf8_casefold_hash(um, dentry, &entry); > + if (ret < 0) > + goto err; > + > + return 0; > +err: > + if (sb_has_enc_strict_mode(sb)) > + ret = -EINVAL; > + else > + ret = 0; > + return ret; > +} Have you even tested that? Could you tell me where does the calculated hash go? And just what is it doing trying to check if the name we are about to look up in directory specified by 'dentry' might be pointing to dentry->d_iname? ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/