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 75C15C2BA83 for ; Sat, 8 Feb 2020 02:14:57 +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 43DAE206DB for ; Sat, 8 Feb 2020 02:14:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TR8L8rlJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43DAE206DB 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=GAaS5uPzUhti1nVTKse+MP7jWSHB8KDXGp5BmNOdpXE=; b=TR8L8rlJjDVGvH YVo3NGQwsMVQSTCTeE/D2RWsZ2tMsW2RV0lVUomf3z1FvCFtSkYo6GEFTb0Cse3vd1FP+/cV4JJkG pykX1y842bBFsPalHoWr65J1HfZTVqisnDKcbvFGTsXHpm+k4m8i5N6wkTUpnc38FlX6TjfwftJhN EA0UXIpcZgMielrsytYQcgvmRk7Z7GKKuoMme+UzdiKRfdV+vd4O/4I2nQgt10dRHpQK/tGpXF8x/ jQwSMCKRdY9UeQBw74L4/8A0CKpv0HZ91iqgKLDCgj0vCQ/AoMYzxOeaPV3JrJIwPsLI4YPN7/LJN M5YG5T9AsHj6vW6uc4Vg==; 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 1j0Fdp-0005fz-VR; Sat, 08 Feb 2020 02:14:41 +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 1j0Fdn-0005Xe-1G for linux-mtd@lists.infradead.org; Sat, 08 Feb 2020 02:14:40 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j0FbU-0098pV-DJ; Sat, 08 Feb 2020 02:12:16 +0000 Date: Sat, 8 Feb 2020 02:12:16 +0000 From: Al Viro To: Daniel Rosenberg Subject: Re: [PATCH v7 2/8] fs: Add standard casefolding support Message-ID: <20200208021216.GE23230@ZenIV.linux.org.uk> References: <20200208013552.241832-1-drosen@google.com> <20200208013552.241832-3-drosen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200208013552.241832-3-drosen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200207_181439_075401_79EF8C42 X-CRM114-Status: UNSURE ( 6.82 ) X-CRM114-Notice: Please train this message. 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, Feb 07, 2020 at 05:35:46PM -0800, Daniel Rosenberg wrote: > +int generic_ci_d_compare(const struct dentry *dentry, unsigned int len, > + const char *str, const struct qstr *name) > +{ > + const struct dentry *parent = READ_ONCE(dentry->d_parent); > + const struct inode *inode = READ_ONCE(parent->d_inode); > + const struct super_block *sb = dentry->d_sb; > + const struct unicode_map *um = sb->s_encoding; > + struct qstr entry = QSTR_INIT(str, len); > + int ret; > + > + if (!inode || !needs_casefold(inode)) > + goto fallback; > + > + ret = utf8_strncasecmp(um, name, &entry); Again, is that safe in case when the contents of the string str points to keeps changing under you? ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/