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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 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 95287C433C1 for ; Wed, 24 Mar 2021 20:44:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0B19661A17 for ; Wed, 24 Mar 2021 20:44:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B19661A17 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 758B26B031A; Wed, 24 Mar 2021 16:44:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7085F6B031C; Wed, 24 Mar 2021 16:44:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A8D76B031D; Wed, 24 Mar 2021 16:44:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 3CC0D6B031A for ; Wed, 24 Mar 2021 16:44:42 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id ED065181C1926 for ; Wed, 24 Mar 2021 20:44:41 +0000 (UTC) X-FDA: 77955946362.38.FBDEFA9 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf26.hostedemail.com (Postfix) with ESMTP id DBBE8407F8DB for ; Wed, 24 Mar 2021 20:44:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id A18681F45E95 Subject: Re: [RFC PATCH 2/4] mm: shmem: Support case-insensitive file name lookups To: Al Viro Cc: Hugh Dickins , Andrew Morton , krisman@collabora.com, smcv@collabora.com, kernel@collabora.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Rosenberg References: <20210323195941.69720-1-andrealmeid@collabora.com> <20210323195941.69720-3-andrealmeid@collabora.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= Message-ID: <7826ef62-49a0-d140-2920-5bdab5bda58a@collabora.com> Date: Wed, 24 Mar 2021 17:44:25 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Stat-Signature: k47n91wkhhygk7e83djetit5currsqzp X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DBBE8407F8DB Received-SPF: none (collabora.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=bhuna.collabora.co.uk; client-ip=46.235.227.227 X-HE-DKIM-Result: none/none X-HE-Tag: 1616618679-75124 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Al Viro, =C3=80s 20:19 de 23/03/21, Al Viro escreveu: > On Tue, Mar 23, 2021 at 04:59:39PM -0300, Andr=C3=A9 Almeida wrote: >=20 >> * dcache handling: >> >> For now, negative lookups are not inserted in the dcache, since they >> would need to be invalidated anyway, because we can't trust missing fi= le >> dentries. This is bad for performance but requires some leveraging of >> the VFS layer to fix. We can live without that for now, and so does >> everyone else. >=20 > "For now"? Not a single practical suggestion has ever materialized. > Pardon me, but by now I'm very sceptical about the odds of that > ever changing. And no, I don't have any suggestions either. Right, I'll reword this to reflect that there's no expectation that this=20 will be done, while keeping documented this performance issue. >=20 >> The lookup() path at tmpfs creates negatives dentries, that are later >> instantiated if the file is created. In that way, all files in tmpfs >> have a dentry given that the filesystem exists exclusively in memory. >> As explained above, we don't have negative dentries for casefold files= , >> so dentries are created at lookup() iff files aren't casefolded. Else, >> the dentry is created just before being instantiated at create path. >> At the remove path, dentries are invalidated for casefolded files. >=20 > Umm... What happens to those assertions if previously sane directory > gets case-buggered? You've got an ioctl for doing just that... > Incidentally, that ioctl is obviously racy - result of that simple_empt= y() > might have nothing to do with reality before it is returned to caller. > And while we are at it, simple_empty() doesn't check a damn thing about > negative dentries in there... >=20 Thanks for pointing those issues. I'll move my lock at IOCTL to make=20 impossible to change directory attributes and add a file there at the=20 same time. About the negative dentries that existed before at that=20 directory, I believe the way to solve this is by invalidating them all.=20 How that sound to you? Thanks, Andr=C3=A9