Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1411748pxy; Mon, 2 Aug 2021 00:27:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2Hx86FMpgFMFMrEZlj/+vBrfBWcYAo1CH9Q8ulbmEQlk2cVTcw+1z9r4GEtHELGslaxHD X-Received: by 2002:a17:906:1691:: with SMTP id s17mr14257517ejd.297.1627889223788; Mon, 02 Aug 2021 00:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627889223; cv=none; d=google.com; s=arc-20160816; b=C0Y4kS0wIcKiigHcdlFpuYvOh2LNUxj6SqRFaib2EOldaSRuy920AD1sVVTQGqRpgn ge/+iRE+Wt8J+IkiJwCth289uBe5dgl9es1rzr5zH/zpNx8yCkO5phk3dQl1JD12tX4G JnoeXl77399BYuw1ti4RJbFMW5UiQh4zeOHMzQRlYzUkHTvtA+hHqWopqBp3x+BLIugm LB3E25dzwGaQaITsDvyTM3KBPPnPSINnyaVqFtu4FLWvZu5SUXH3/dZf49P67gQFrxkM Mr9m7WVA8J8TDhtteMwIwbQzlMhuEzRopa1xfViKNmDklFOH9m4oEOpJiy46BPejyQda PvcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FZZDS0C0c3OMyW/avnHFTdWap/Nw+b8H6QX3N9aGP1I=; b=XdNuNFIDGMJG6oJLGyACmkAPwTCfFFPMPE6TL3yAY07C1dxEq6nr6UnQnyK9RhcUhV yZpohyQ9GZEXJND51yQPCopVXtZsBnyA10pk5UNysT0cuv+tDcXz3SgskCWC3J8aavHE g4/b3przD/KwPoDaCrNmsCHelRPWZdqBMrg2BftrEhWHB7BMlcoBgEHRK5hXApEobs9Z tfwbASI99rI+b4lJ55b6xbE9kIKHHqSUsYL+tDVK/MI2RJcif8gohoeCPZw8pn0ndNZ5 cZzgwca1/RMw8otj0YNmYZakmmexKd9MnnShmX2Dv9M/y8a9x0R9LBHNoLfm8DDcZCng GIPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si9902080ejy.5.2021.08.02.00.26.28; Mon, 02 Aug 2021 00:27:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232249AbhHBHZy (ORCPT + 99 others); Mon, 2 Aug 2021 03:25:54 -0400 Received: from luna.lichtvoll.de ([194.150.191.11]:36381 "EHLO mail.lichtvoll.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231649AbhHBHZx (ORCPT ); Mon, 2 Aug 2021 03:25:53 -0400 X-Greylist: delayed 630 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Aug 2021 03:25:53 EDT Received: from ananda.localnet (unknown [IPv6:2001:a62:1a6e:4000:77e0:fef8:7961:c8ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.lichtvoll.de (Postfix) with ESMTPSA id AB4A9298406; Mon, 2 Aug 2021 09:15:10 +0200 (CEST) From: Martin Steigerwald To: Miklos Szeredi , NeilBrown Cc: Al Viro , Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , linux-fsdevel@vger.kernel.org, Linux NFS list , Btrfs BTRFS Subject: Re: A Third perspective on BTRFS nfsd subvol dev/inode number issues. Date: Mon, 02 Aug 2021 09:15:09 +0200 Message-ID: <3318968.VgehHcluNF@ananda> In-Reply-To: <162787790940.32159.14588617595952736785@noble.neil.brown.name> References: <162742539595.32498.13687924366155737575.stgit@noble.brown> <162787790940.32159.14588617595952736785@noble.neil.brown.name> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Authentication-Results: mail.lichtvoll.de; auth=pass smtp.auth=martin2 smtp.mailfrom=martin@lichtvoll.de Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Neil! Wow, this is a bit overwhelming for me. However, I got a very specific question for userspace developers in order to probably provide valuable input to the KDE Baloo desktop search developers: NeilBrown - 02.08.21, 06:18:29 CEST: > The "obvious" choice for a replacement is the file handle provided by > name_to_handle_at() (falling back to st_ino if name_to_handle_at isn't > supported by the filesystem). This returns an extensible opaque > byte-array. It is *already* more reliable than st_ino. Comparing > st_ino is only a reliable way to check if two files are the same if > you have both of them open. If you don't, then one of the files > might have been deleted and the inode number reused for the other. A > filehandle contains a generation number which protects against this. > > So I think we need to strongly encourage user-space to start using > name_to_handle_at() whenever there is a need to test if two things are > the same. How could that work for Baloo's use case to see whether a file it encounters is already in its database or whether it is a new file. Would Baloo compare the whole file handle or just certain fields or make a hash of the filehandle or what ever? Could you, in pseudo code or something, describe the approach you'd suggest. I'd then share it on: Bug 438434 - Baloo appears to be indexing twice the number of files than are actually in my home directory https://bugs.kde.org/438434 Best, -- Martin