Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdFUOsc (ORCPT ); Wed, 21 Jun 2017 10:48:32 -0400 Date: Wed, 21 Jun 2017 22:48:26 +0800 From: Greg Kroah-Hartman To: Tejun Heo Cc: Christoph Hellwig , Linus Torvalds , linux-fsdevel@vger.kernel.org Subject: Re: odd sysfs find behavior, was: Re: [PATCH v6 00/10] Implement NVMe Namespace Descriptor Identification Message-ID: <20170621144826.GB15646@kroah.com> References: <905ed2e6-1c1c-f3a3-5391-66e42fb61861@suse.de> <20170616095837.GA14217@lst.de> <20170617120814.GA13236@lst.de> <20170618011250.GA1987@kroah.com> <20170618073249.GA25797@lst.de> <20170618073305.GB25797@lst.de> <20170618102020.GA28042@htj.duckdns.org> <20170618134336.GA32701@lst.de> <20170619175934.GB12062@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170619175934.GB12062@htj.duckdns.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jun 19, 2017 at 01:59:34PM -0400, Tejun Heo wrote: > Hello, > > On Sun, Jun 18, 2017 at 03:43:36PM +0200, Christoph Hellwig wrote: > > On Sun, Jun 18, 2017 at 06:20:20AM -0400, Tejun Heo wrote: > > > If you "cd /sys/kernel/debug/tracing; cd -" before doing the find, > > > does it succeed the first time? It could be that the on-demand > > > mounting of tracefs is giving incoherent results across the mounting > > > and confusing find. > > > > Yes, that works fine: > > > > root@testvm:~# cd /sys/kernel/debug/tracing; cd - > > /root > > root@testvm:~# find /sys -name uuid > > /sys/devices/virtual/nvme-fabrics/ctl/nvme3/nvme3n1/uuid > > /sys/devices/virtual/nvme-fabrics/ctl/nvme2/nvme2n1/uuid > > So, looks like this is the debugfs automount mechanism changing nlinks > across automounts and confusing find in the process. Greg? That's odd, is find racing with itself here? I don't really know how to do anything about this in sysfs, as this should happen for any other filesystem, right? thanks, greg k-h