Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1115802ybk; Wed, 20 May 2020 22:13:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzte+U1n+5lWj0hUBMdQzKrIRJaNlBFPj/yJUo51x8MLpwwW4kNUSt8yGRz0X2NRZfvDiJB X-Received: by 2002:a17:906:4886:: with SMTP id v6mr2107773ejq.11.1590038018170; Wed, 20 May 2020 22:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590038018; cv=none; d=google.com; s=arc-20160816; b=Irp9MknXPFbzw/Fbqplm60G3ajRGrRdQWloRDWz0BpC7Uzp8N9DHulYVkdEcDPn8Qt mqigNma8K35+6VvD4ZaE6qXdsFIp33Xg8zNdqLSSxQYLj14o1+dJKmnSH2rEyDBaL/Vo oPLL2iLEVthd6xLYd1loLfW3NoqvzZCWbRCBsNBsSCF3bpb2D9BfnALx50O6Y9wxjUH/ 5jSWgL7UbPV36rfVgooCzuEk9vHYUOHNOx62nk7+nVkso2ti4s4GNgemq19zmeTFHD8q cnZpiwwp2P5UnWo8Zyjc4x0GLeCNdcIFrxJdF4x91YHgaBX06NCzZeYjrgOiGmmVdSJr vrFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:date:to:from; bh=HQmZPpjuX7aXNmfXh5iC3CtE8BpVCqio7uIRvh+ivZE=; b=CUzpSN6k9Fa3PO6890ixDK/KTr9HKM9+Dco1HgpxX2hZ6mqkHjpsE/vORyjf0EoaQ7 LU95k+jQ51DoymoRrkoSp/q7w93erEnDDKkDgMTObapETzi1hdwDMFzwagLdUKwwaV7H K9JQAIpEIZ8JPxG1zhT0HHseqfE6y3jxrNjOt1SMZTj8SR0xg1+Ah7noSmTZVWDP6xbk p7prZVkQFrYA9GrbNBRu/jevJYGzgiI+r6ney595KJzD0XBrgvXyksQRv5528q5/p9w4 cHcZDi1YoWxg4aVgfqnrjHOA4Zoluwig8XXKm9hpjhtpdykhvUbddosKW2dDMQKUT+wj 0EIw== 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 f4si2707534ejb.362.2020.05.20.22.13.02; Wed, 20 May 2020 22:13:38 -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 S1726821AbgEUFM7 (ORCPT + 99 others); Thu, 21 May 2020 01:12:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:34104 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgEUFM7 (ORCPT ); Thu, 21 May 2020 01:12:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CF7B0B213; Thu, 21 May 2020 05:13:00 +0000 (UTC) From: NeilBrown To: Craig Small , linux-nfs@vger.kernel.org Date: Thu, 21 May 2020 15:12:49 +1000 Subject: Re: How to separate NFS mounts have same device ID In-Reply-To: <20200521023055.GA1246587@dropbear.xyz> References: <20200521023055.GA1246587@dropbear.xyz> Message-ID: <87eerdan1q.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org --=-=-= Content-Type: text/plain On Thu, May 21 2020, Craig Small wrote: > Hi, > I'm the author of the psmisc programs that include things like killall and fuser. I have a problem with finding files open on NFS mounts from the same server. The issue is at https://gitlab.com/psmisc/psmisc/-/issues/10 > > The way fuser does its job is to find the mounts you specify and collect the device IDs, then scans all /proc/ > Putting it another way, if I said "here is file /proc//fd/3, dereference the symlink and tell me which of these two NFS mounts from the same server it comes from?" how would you do it? > A simple string match (/mnt/a vs /mnt/b) does not work because you can have symlinks across mounts. I would examine /proc//fdinfo/3 and extract the 'mnt_id:' number, then look for that (as the first field) in /proc//mountinfo. NeilBrown > > Any help here would be appreciated. I'm not subscribed to the list so hopefully, this makes it through whatever filters there are and please CC me on replies. > > - Craig --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAl7GDdQACgkQOeye3VZi gbmRIRAAspnl4XAGQbyhYdRpvczTXVCW2+pI6auDReMK9BfdFZ2cOQDZOV/mo1dT SSbq9cBctuVghelRy/6aA+PNA09Wm2BeA7v+gyPKNX/ocbAlqlSXjzueq16ZMLPj Q9l84fWYu4NJtd1jlxD3SYwbxV/C9XZb5UVdtbEb5fKs7eRSBYpz7VT7+0DOMgzu VU7Ml8qr/6fVTbPki9+oYugGkeSQJXnMOVwjiFuYU/ShgMXR8FiRMve7YSJ4os4J oxqeF2MI0Pe3vX9JoVfiHYUP+4puqJgXvpKExO9Z2EIulk6rDCk15OS7oz2LciUv 9c1pe8nGh8DMz4gPd72K2BHKzdzv4bYpnpgeHyv/8FafeQWasss+yBPBouHIwkbM PBJh7Blj0o7GekVwQ/9YJIqpJplLB4qsv6oBPgzwTByqpOA67nzC1Y7iNAk0eUSS eci6U7nvWN2QzQncBRVkvIZBLJ+xJ3MQZ7rh7RtXMh0VXZl+I48gzxQOoz3cjIaY V+dgXHeyioGIaPytepfcmxmb6WTxz//YMXzTzbOQj8L4biezv8XMzZ2Y3vwRIq4H xsVXDAVIUeuwbBMwz9xfPhPyTGPI1HHRQo/AbMKqMIFpcblFzf1FQjsbS6NCj1X7 dqcG6c0oxq1r8tGSERppw28R90isfvkuTdY567Fgp4YsOuCqEXY= =uTa8 -----END PGP SIGNATURE----- --=-=-=--