Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1486652ybm; Sat, 30 May 2020 10:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB5KbFuZjqEQFLrBJ4tAVG3FV4RjYEhw2ZRx+CE+9LEVCRjE/aLTUMl0f26V/WaYcynpyb X-Received: by 2002:a17:906:3456:: with SMTP id d22mr6626082ejb.358.1590859139892; Sat, 30 May 2020 10:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590859139; cv=none; d=google.com; s=arc-20160816; b=TAIy3RhUqyEUlvIxgA4LSioc8TXs4D9C1U/JXaSrBCYNXwg8ZfiGySjNqeyCISKLge 2qPwd8VGGUbBL/F7uHULyzULEGq1h2HakE19w/49fRSXb2qKppbPNOi02dSHYy3Mz2mP 1eCGkuuvH1s2NTU4R+HDJEDtNEgQx2DLbXfsCY7bD4cX5SdShv5s5M0EPt+Z3cDQKPha 5ik+AyuN59ECte089vHidFFTsWR24Pr7aSoIcq20Ix422y/C+GoFuBcF3glhk8b+w1Pv 6TO+Q5X9YT1qu9gBV5W7TUQQaembRK0X4IAfZ6VGw8v4+G04LFAYUZ9a3yCCqwDf570M t8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L01rcThTXQGPtzbd1sl02vy/AZKkMVDpxcktglSDj/Y=; b=xbZUo3DM1ixLj0utHV3pHvItJerUOwSEQ6oIokuZnpTUp3LQ7KMMwiz1xRhXqLhZqz +FN+Gsbf4LNW1bCP8FynztNgpLG/i0mXPh1tclKcIqF17MqxCbOkiGCEWCxrfNTUQ4Vq iKrN+QS0Xxjju2pA99RL7wC/j+shBmDE2qF4eFTqKX78l4pCkTmwZKKM8NtNKCtXC+d4 X0LlaLMy1ftHz7Wkdmbeo0D8lFluL13dib/N/wm0kux2MpttqHY5zmCAXIhnTISkB5bf teF31LZNPboXUsGXZjntKSpvSvydJNI9ZN+/+ENO7UHZnYIwlsJgegyu+zQjMoVIY5gg 8pxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HBJu6Snm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si105259ejz.752.2020.05.30.10.18.27; Sat, 30 May 2020 10:18:59 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HBJu6Snm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729083AbgE3RST (ORCPT + 99 others); Sat, 30 May 2020 13:18:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbgE3RST (ORCPT ); Sat, 30 May 2020 13:18:19 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B095FC03E969; Sat, 30 May 2020 10:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L01rcThTXQGPtzbd1sl02vy/AZKkMVDpxcktglSDj/Y=; b=HBJu6SnmC5B1P9o9UOfR2HZWJF AiFIR3Id9rSPCYStLx2L6hC4V6jDcbiu2BxjaA+pTXEFjbHsWlPqYF25uodE12GuP/0Zjgf8XvKbr hkL7GP7CwiJ0FSMTYk56M9ldfCihszDY4LJyfIzZwp5nNDg78qvwF/iFloICjidC7u1E0w3Uzr2/K TZuae9dpDqIxbBro4CThKmqZe6WoJMmo4MK7+xZeHi0fm6uiYFPk0QST0Vn5gMNPD584cNn4pMYw5 6WeizdsrEO7j/X/cGP42rGjJ72GVK1oOyKRVLfZBzMSJEIylXmZGTL1DribFuW5jTuegTqrgmdUMl dZRvZHBw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jf57e-0000cg-Ga; Sat, 30 May 2020 17:18:14 +0000 Date: Sat, 30 May 2020 10:18:14 -0700 From: Matthew Wilcox To: Eric Biggers Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, stable@vger.kernel.org, Al Viro , Daniel Rosenberg , Gabriel Krisman Bertazi Subject: Re: [PATCH] ext4: avoid utf8_strncasecmp() with unstable name Message-ID: <20200530171814.GD19604@bombadil.infradead.org> References: <20200530060216.221456-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200530060216.221456-1-ebiggers@kernel.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, May 29, 2020 at 11:02:16PM -0700, Eric Biggers wrote: > + if (len <= DNAME_INLINE_LEN - 1) { > + unsigned int i; > + > + for (i = 0; i < len; i++) > + strbuf[i] = READ_ONCE(str[i]); > + strbuf[len] = 0; This READ_ONCE is going to force the compiler to use byte accesses. What's wrong with using a plain memcpy()? > + qstr.name = strbuf; > + } > + > return ext4_ci_compare(inode, name, &qstr, false); > } > > -- > 2.26.2 >