Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp731305ybl; Wed, 11 Dec 2019 06:42:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxW5zQA3G+Zr1uFWRF8qUX/Kn0jbJBjlNWTIh2eX1z8rZPHsRmkyQCDZZLL5sWu/rrOWsSj X-Received: by 2002:aca:bbc6:: with SMTP id l189mr3056289oif.53.1576075331445; Wed, 11 Dec 2019 06:42:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576075331; cv=none; d=google.com; s=arc-20160816; b=AURQjtw8WIA2vjzsIjB/DMah00F30MusGql5553yjtGUCr7EGODEIvRFr+lfxLpmCl SRZ/pnxn8m0cG4PeTeyhwxRn7uFL/l9XnWI+1RIbbzClP+5Iesa+yUb4QH5b6drO6axm s4BsNjII7VrRQ7yXseGfmhegPhuzUUmMPL+PuRgaO+Cm3j0MHEEILQkCxeVA19CTgtJB Yiuhl2WeaDCg/n4O/fxrR2J8KGzYqAmRO1mnrDZ5GaDT11KbAmBQAFKPsY+vKOPnAeCX r/lz4W6mGkG/UWscIibT1I8YHjoKlMDq4tlepgMhr1soqTQT8PInx0hBsYjVZDcAeXq/ sy0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; b=lVwHsXOLu0VUgqNvh+UCXtymDbUIL6/HDChSGvW/Xbi37K3pWufuo5HWEQozlXkY1O 2IMJZgWxn6Ugz2/JLXJ6KY6FcyiWH1jr6///IoaklLJlc+TUs9h4ZuX8e6tBzU8cW6io xI6+nrpQ3vgPkHMV0AyATjd6l4VP6PudGiVD6RaNI3/bfaFJ5dOnE6Kt9W4UIJ40tZRk kqPMD3ne+dTnK+mHDCGNFaSREIwAt/3N9x+7a7W9I2XKC62VRx81SFkUd+CoTs5HBT5I gKS3gS16MWOrf74LS6qmTxo7Pb/vMaGpL/Q4canalKWAfKC5k5S9Zh1MQJvkbvApztzF yF8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=fsjcTIV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si1243402otj.148.2019.12.11.06.41.58; Wed, 11 Dec 2019 06:42:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=fsjcTIV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730075AbfLKOla (ORCPT + 99 others); Wed, 11 Dec 2019 09:41:30 -0500 Received: from sonic316-54.consmr.mail.gq1.yahoo.com ([98.137.69.30]:38935 "EHLO sonic316-54.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729994AbfLKOlZ (ORCPT ); Wed, 11 Dec 2019 09:41:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1576075283; bh=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=fsjcTIV9H5UBmlvgJKstt4aT/VgsSf7yCPzptrD0iuurqBijQPf9SpJnVF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h1u6VlKMRU4Qa5Y6nVx.9i51cjRtrDeD3a673qQVRb2i7OVtHbFgmsU84B_Vd 7yqO3rtnmsGO45TPuMMTOrdQNBVQB.H62evznpNyGJgpr5btZicu4VYFtWFySdrSPrQ2sZmBFPPX txqmSEGEm8GyzRCsSMWyvset0sc50Kc3SOTFcsAwtlinDM55dJjAd3Sht3mAF49ttU27GypPpFUP 6SzBMznAm6FS6EUxwy4PlXc1HPvF6HkXiffyCsthLUMy0WHG48OYxXeAgl2H1G.d5tqyYbwsNn7W FjS9MKf12dXY8FzTo32qAK_0Ng8M9GXVUdvsdb0I7pECxp5aCvEsVbt7FItG4HMBS8ztJPYZ54bE p2uwf.B1hmfnt87hZfIkVw3r4m8OXYszcbUqsHX3WhM.BrghCdqycqzRu8O8jJu2fsuSdFx_hWV6 MMhCq72YiZxrk5xuN7XJeo.18JqmD0l66geIQWB38WxgtbOTN1xfgchBgzW.Bh_QC5Bqlgs.OBQr Ia_BVgCLitKrmkzLIiz9p4trv8BhmG2JQ7291iwAdXwRoFB5MgE4ohNYRsGpcSDDE8hgmWkQJqvB 6_qUOovThV5EDGgwha5sBn8uY9VkIK.irycx0ed_u0gv7ilE_lZPAm9v8iexz5HMXgN4B3vwhHSW E Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Wed, 11 Dec 2019 14:41:23 +0000 Received: by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 36f5534268c63ff9379ab7e119e12b1f; Wed, 11 Dec 2019 14:41:18 +0000 (UTC) Date: Wed, 11 Dec 2019 22:41:00 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Gao Xiang , Tiezhu Yang , Al Viro , Eric Biggers , "Theodore Y. Ts'o" , Jaegeuk Kim , Chao Yu , Tyler Hicks , linux-fsdevel@vger.kernel.org, ecryptfs@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, "Darrick J. Wong" Subject: Re: [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup Message-ID: <20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1> References: <1576030801-8609-1-git-send-email-yangtiezhu@loongson.cn> <20191211024858.GB732@sol.localdomain> <20191211044723.GC4203@ZenIV.linux.org.uk> <4a90aaa9-18c8-f0a7-19e4-1c5bd5915a28@loongson.cn> <20191211071711.GA231266@architecture4> <20191211134014.GM32169@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211134014.GM32169@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailer: WebService/1.1.14728 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) Content-Length: 1007 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthew, On Wed, Dec 11, 2019 at 05:40:14AM -0800, Matthew Wilcox wrote: > On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote: > > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len) > > > { > > > if (len >= 1 && unlikely(name[0] == '.')) { > > > > > > And I suggest drop "unlikely" here since files start with prefix > > '.' (plus specical ".", "..") are not as uncommon as you expected... > > They absolutely are uncommon. Even if you just consider > /home/willy/kernel/linux/.git/config, only one of those six path elements > starts with a '.'. Okay, I think it depends on userdata and access patterns. I admit I have no statistics on all those callers. Just considering introducing an inline helper for cleanup, except for lookup_one_len_common() (since it's on an error path), others were all without unlikely() before. Ignore my words if it seems unreasonable or unlikely() is an improvement in this patch and sorry for annoying. Thanks, Gao Xiang