From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id AFD0C7462 for ; Mon, 23 Dec 2024 08:26:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942394; cv=none; b=s7yOeH+6ZdVZY4n6t+EslNkhPmK5N7MbBVTjkGvER6J6u3NP2NxSq29AY1Y03lxrEGfxpgupL0JDjOwgMW4Iv6yG5pr+Ogs7F+YdwYDbhxTxYLAIOjzBjdbj9nhGdjwNXodkVygEPKmCVR56uRR21xBvsf11Jz8bKCZVpvhOC/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942394; c=relaxed/simple; bh=DdKDHOqecIHaek8l7rF2dDaPvdAF/Ob4R2dXYZgwJcw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YsjqvsH2LOfazZKzRQ9uwEFdIz9213iCj1l4DFFBZRPzZvXU+tarCELe7syPuMFE1816n0u5VPMbV3osb4JE6sk0WP7kVl/cdkNadMFT2dnaJ3rJBFzaQWbhAQgAcBu+8UWV40OxGU2pP6609husRDcHN+DUrhydj/FjAMOmXew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=cCBA5bDY; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cCBA5bDY" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=FKi6OwAeOuymBx9/APs/sfo5EFcqTrkzLfNDNZUJI1w=; b=cCBA5bDYEAyVjJNvvcO/dtJz+c J/pxz4lGXMpPgBsRbOKaZM38jHBYtbPLn7P4uTh3mNiY9VfQ9SoTuVNMfzX+WSWq1nZHs5IU9RNz5 j6/MeioDZEjKY2GdBZlwPCdFGEoT+9gID94R4wyRnWWulOaNbp+/FjcA8yVZ/jWfKFmadGO3I13p3 kKPURLRO8LYR9dvTPPxmbRgeGvLBbVN6P6acfIT0+KKrV2GXwskLvCydtfosR2Jge2pDM6DPudTpS 8sbq0/TG3j1gUhPacO9GEAOC4tV0RnO1SWZOBkJpQtXHo3hZuKzehaxpqZWWHJ49PH3hAm4Yocs5B QGkixDLQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tPdlm-00000009aNp-3zRF; Mon, 23 Dec 2024 08:26:30 +0000 Date: Mon, 23 Dec 2024 00:26:30 -0800 From: Christoph Hellwig To: Daniel Lee Cc: Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] f2fs: Introduce linear search for dentries Message-ID: References: <20241220172136.1028811-1-chullee@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241220172136.1028811-1-chullee@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Fri, Dec 20, 2024 at 09:21:36AM -0800, Daniel Lee wrote: > This patch addresses an issue where some files in case-insensitive > directories become inaccessible due to changes in how the kernel function, > utf8_casefold(), generates case-folded strings from the commit 5c26d2f1d3f5 > ("unicode: Don't special case ignorable code points"). That also breaks all other direct hashed and needs to be fixed. > > F2FS uses these case-folded names to calculate hash values for locating > dentries and stores them on disk. Since utf8_casefold() can produce > different output across kernel versions, stored hash values and newly > calculated hash values may differ. This results in affected files no > longer being found via the hash-based lookup. > > To resolve this, the patch introduces a linear search fallback. > If the initial hash-based search fails, F2FS will sequentially scan the > directory entries. That means you have really bad worst case behavior for negative lookups. I don' think this is in any way a good idea.