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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 162A0C433FF for ; Thu, 15 Aug 2019 07:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E736420644 for ; Thu, 15 Aug 2019 07:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730469AbfHOHBh (ORCPT ); Thu, 15 Aug 2019 03:01:37 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:50169 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbfHOHBf (ORCPT ); Thu, 15 Aug 2019 03:01:35 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 34AD7806FD; Thu, 15 Aug 2019 09:01:20 +0200 (CEST) Date: Thu, 15 Aug 2019 09:01:32 +0200 From: Pavel Machek To: Gao Xiang Cc: Pavel Machek , linux-fsdevel , LKML , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , David Sterba , Amir Goldstein , Christoph Hellwig , "Darrick J . Wong" , Dave Chinner , Jaegeuk Kim , Jan Kara , Richard Weinberger , Linus Torvalds , devel@driverdev.osuosl.org, linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Li Guifu , Fang Wei Subject: Re: [PATCH v7 08/24] erofs: add namei functions Message-ID: <20190815070132.GB3669@amd> References: <20190813091326.84652-1-gaoxiang25@huawei.com> <20190813091326.84652-9-gaoxiang25@huawei.com> <20190813114821.GB11559@amd> <20190813122332.GA17429@138> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MfFXiAuoTsnnDAfZ" Content-Disposition: inline In-Reply-To: <20190813122332.GA17429@138> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org --MfFXiAuoTsnnDAfZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > + /* > > > + * on-disk error, let's only BUG_ON in the debugging mode. > > > + * otherwise, it will return 1 to just skip the invalid name > > > + * and go on (in consideration of the lookup performance). > > > + */ > > > + DBG_BUGON(qd->name > qd->end); > >=20 > > I believe you should check for errors in non-debug mode, too. >=20 > Thanks for your kindly reply! >=20 > The following is just my personal thought... If I am wrong, please > kindly point out... >=20 > As you can see, this is a new prefixed string binary search algorithm > which can provide similar performance with hashed approach (but no > need to store hash value at all), so I really care about its lookup > performance. >=20 > There is something needing to be concerned, is, whether namei() should > report any potential on-disk issues or just return -ENOENT for these > corrupted dirs, I think I tend to use the latter one. -ENOENT is okay for corrupted directories, as long as corrupted directories do not cause some kind of security bugs (memory corruption, crashes, ...) Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --MfFXiAuoTsnnDAfZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl1VA0wACgkQMOfwapXb+vJ0RACeIl9SXkQ+HyKjoz6KEOY1IIxQ fokAoLx3vqeReYdzJjSOjFpCjcgEgtud =GkrJ -----END PGP SIGNATURE----- --MfFXiAuoTsnnDAfZ--