Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2251145yba; Thu, 25 Apr 2019 13:11:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJmKTrQm9D1VNt8l9kTeuI4jYDrR7uKZ7EvQjOpIil+CXkoYQeiEXmNdmspNmNv3N6SPDt X-Received: by 2002:a65:5941:: with SMTP id g1mr39579449pgu.51.1556223068952; Thu, 25 Apr 2019 13:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556223068; cv=none; d=google.com; s=arc-20160816; b=M+tJ4wUulAHGDVqzW/MVC61tSSHqw8+Wjd4Lkk0TpbQyhM6SMURk34+6cRyBkLPOmf WwGgnPa8YQqhjWSX1inWGckZIqi6eEXj5Of2hWhsmU9+EMXpsQ5fVMkjfdFMRSH8YfZR 1Y46e0a1nH63JVESjmT+6d0MDwvpa/8gJ1kwUxW0AwNa2R2JyjKvZowlmldJZJ11RfCC VNDWLVqiZK7rVhaWuux+aXVWE+weLKlKtrcs7Wd/3cM+2vLEyWT5nrRgaRIvfwHrky4Q VCxsKruVCCW24iDHc+38BWNaAIp6iG7wNplzHL9sAsHWQi1Z002RdKinhfcwGO9oP/Uu fXUA== 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; bh=iYufyeioAafbfY3YSFdh9crjvsuL/RxZAGWWDohTG4k=; b=kljtzHdz3l/sUS033YJ70WONeNlTW+o1l1+4dX5rCyx8ytt/Ms5AI+ECe9LUQn3E8F wOeN0zYbc7w1YjJMYGVhchHmX2jfxxsoQtOKw2JSO/l4IKq2QouQyhWstrLyjGCve0Yl KDuyFlXhYZfdMlTlNbqc98eq/ZoLjRfdAOD4zws7IVViOMvHtFS/OD7cq/5nstSfF+jK EgAtR95+QcDg+BQ644nWjFg7IaV9/aIdJ1ePkO4p6iH1t15HIY3TLX+o7MGwOkz2q6vK v/Ss2hfiCZKTpvNhYGBHuVz6EKVD0cvtxbV4Aa+DPrCksafKCxOz7deRfWomvUnm4AIK UQGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 n12si23377223plp.223.2019.04.25.13.10.53; Thu, 25 Apr 2019 13:11:08 -0700 (PDT) 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; 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 S1730900AbfDYUJp (ORCPT + 99 others); Thu, 25 Apr 2019 16:09:45 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51480 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729918AbfDYUJp (ORCPT ); Thu, 25 Apr 2019 16:09:45 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hJkgg-0006nb-4G; Thu, 25 Apr 2019 20:09:42 +0000 Date: Thu, 25 Apr 2019 21:09:42 +0100 From: Al Viro To: Jeff Layton Cc: Linus Torvalds , Ilya Dryomov , ceph-devel@vger.kernel.org, Linux List Kernel Mailing Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7 Message-ID: <20190425200941.GW2217@ZenIV.linux.org.uk> References: <20190425174739.27604-1-idryomov@gmail.com> <342ef35feb1110197108068d10e518742823a210.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <342ef35feb1110197108068d10e518742823a210.camel@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 02:23:59PM -0400, Jeff Layton wrote: > I took a quick look at the dcache code to see if we had something like > that before I did this, but I guess I didn't look closely enough. Those > routines do look nicer than my hand-rolled version. > > I'll look at spinning up a patch to switch that over in the near future. Jeff asked to put the name length in there; looking at the existing users, it does make sense. I propose turning struct name_snapshot into struct name_snapshot { struct qstr name; unsigned char inline_name[DNAME_INLINE_LEN]; }; with void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentry) { spin_lock(&dentry->d_lock); name->name = dentry->d_name; if (unlikely(dname_external(dentry))) { struct external_name *p = external_name(dentry); atomic_inc(&p->u.count); } else { memcpy(name->inline_name, dentry->d_iname, dentry->d_name.len + 1); name->name.name = name->inline_name; } spin_unlock(&dentry->d_lock); } and callers adjusted, initially simply by turning snapshot.name into snapshot.name.name. Next step: overlayfs call site becoming take_dentry_name_snapshot(&name, real); this = lookup_one_len(name.name.name, connected, name.name.len); Next: snotify stuff switched to passing struct qstr * - fsnotify_move() first, then fsnotify(). That one would * leave callers passing NULL alone * have the callers passing snapshot.name.name pass &snapshot.name * fsnotify_dirent() pass the entire &dentry->d_name, not just dentry->d_name.name (that's dependent upon parent being held exclusive; devpts plays fast and loose here, relying upon the lack of any kind of renames, explicit or implicit, in that fs) * ditto for remaining call in fsnotify_move() (both parents are locked in all callers, thankfully) * ditto for fsnotify_link() * kernfs callers in kernfs_notify_workfn() would grow strlen(). Next: send_to_group() and ->handle_event() instances switched to passing struct qstr *. Next: inotify_handle_event() doesn't need to bother with strlen(). Next: audit_update_watch() and audit_compare_dname_path() switched to struct qstr *. Callers in __audit_inode_child() pass the entire &dentry->d_name. strlen() inside audit_compare_dname_path() goes away. Objections?