Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp665203ybl; Wed, 11 Dec 2019 05:42:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxK6U2N43GHg/AoM/B3Ag1MBlc9045ZVWjs4rSzFSTxQUH7kZD/p8T+XjMuSIkh85VzLbzC X-Received: by 2002:aca:1011:: with SMTP id 17mr2865419oiq.72.1576071727051; Wed, 11 Dec 2019 05:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576071727; cv=none; d=google.com; s=arc-20160816; b=ilNoIqtEEw3EZKIdVXGKjyFAIx4FukxHGxwaXUCI63BJjgtMYvqcUSDmOq5KHRaXvl 2jrBk/ZbTenbGVTmVu8lBpSnq5tjhRp84Gm5wIDyxC3vexsWeBaRPdLjYWmZVeRtbiSL gMO525quDuHet8/hyG5fhYmP/wWet/BXnGZ/hr9LncM8wBl2CpqInt2M9P+AZteQ+r9/ TJAtl5YLJhHOXHz5ArFK7WOeI5tpFdu7jjySfDoVwZGMUkmB/9CVJr0ffkeSIYs0uBD9 hiF43C+wUGC6GvIHLvnCvdWFwA81hck2w6P+K1p51rSvDlu75oTMKibhKU4IfVNITBhP ehjQ== 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=TO/NQu43CwshSv+vhfJaELWZCqACamoqyzyHY52rGyI=; b=NOiGagm8rUNY+U4DQX3OB5qP4erYJwO8tXK2X+YjUQGiEaHkvWEuAv7aARB36N14nJ Fk9dPnE7Y1iEe02JmZ/IcY8cMGrZvGRvf3PeS6L9uWoxpJMrmNNeqX0I7T5Ym7VPxVFh bJ0QLq5x9KWEhLQTzzGeo7q62hVzMYdWsLljbcKkArUDiFB7m9T9FlJ5Ma3gMMxsmqZZ YPzIu4DuSxBndpX2ny9hbFNcXF55FmLzxvODMwo/i12tfJsOLa7rmJsVVkRny+OTV/T1 DYxriNG8Ds4Wf98KkUieqradiSUEfQsAThabdSlna+J1jyflSdRPIfZNcsfur6/NnfkW gcZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hm5ukJbK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si1221419otp.139.2019.12.11.05.41.54; Wed, 11 Dec 2019 05:42:07 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hm5ukJbK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729705AbfLKNka (ORCPT + 99 others); Wed, 11 Dec 2019 08:40:30 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52272 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729694AbfLKNk3 (ORCPT ); Wed, 11 Dec 2019 08:40:29 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TO/NQu43CwshSv+vhfJaELWZCqACamoqyzyHY52rGyI=; b=Hm5ukJbKRW/dIRfBb/2QNZWe2 Vae7uQ8jSnwfWdaHao9+Puztkj99WQrJ7zQDtxi3TKPOo51rd+fWVnahFZcDzJMLSfqaeCVOxY8r8 hSDFkS06G9RcE/1zSS+DssYsnx/A7E90d2pwJo7gUwe3HnBcGCaB6EInTzmXq7MjnqZrB6PQ9l80I 7ew0MBvO3B1tKmL5VXVbKgHK2ypAVx9SJpNzWZYDva4N0EkaT4mjOj0OdxLfNDh2Hm0LJ+ExnAOxv /fglK8GQjc+Ilwz9wP2d/9ugBdBSYMjmgf/rR71BiJvLC/FiZ8ANkzJvpE2LyxvPeev4t3IujdjyX vbRr8RJTA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1if2Du-00050n-Qc; Wed, 11 Dec 2019 13:40:14 +0000 Date: Wed, 11 Dec 2019 05:40:14 -0800 From: Matthew Wilcox To: Gao Xiang Cc: 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: <20191211134014.GM32169@bombadil.infradead.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211071711.GA231266@architecture4> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 '.'.