Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5517065pxb; Mon, 7 Feb 2022 04:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRkTSyCnfB9aTiH/L2r1qJxb1Nq6brbrD/wXo1ipPKfSMMwXpttKVguv50R0wfRnYMqjrT X-Received: by 2002:a17:90b:17d2:: with SMTP id me18mr13861784pjb.141.1644235212045; Mon, 07 Feb 2022 04:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644235212; cv=none; d=google.com; s=arc-20160816; b=jjbJh8aWl6gykoNMneNQxszqAePaEKJYkdxPDP13AvlAmBey8JYsqAsEIVg19/WA4A w/eKHFu8FbUc8l18zEiqSo6Tisn8MTn+3JDZxO6fpTfkatlDiwDOWPA2dhEx73u4SPCT +uZ3yXicEsssnTxXa1m+0BfcnjoGhYYKToRAvq6KVWfPrxwoRE0upfci4arf4EECX23g skjLI2+V17YYg826JRHbu5JJoRarRtGgY1sGgr9QTez7Y7u6n1Eo8ZKqRNyO14vfK9p7 hoSQh71ozJ/7qrXHhyBZgWbSfuZb9n5vSTv1/gz+cb+m2z3FBSpBJ5K+vdImOZVd82pi 3Tig== 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 :dkim-signature; bh=iqhdPBrGJMzfcGa86Tjdx0q1TgnB8rdKF3/FSnu8UTs=; b=HAeAScO9i1ngrG2GNbWpAcHOiqsu8Iz+KCkLA6N8gJJbAF8jFCQb1WgFtnwovpxwRu 0F5bHvcYNSVn02RfJwifqbbyRuc96ogDwdclhzM9zX6ePZ7E5hGpOpYSQtX1pAErbT2o rS1/JmClWwHasMGKgXmJdCXBMc4K8zIpgL0ZSLE08vS51D6afows8EiG2RPIlqcjSZzA BJu9/zwclx9fBrlhDip4bajTSApxHjCLsBpx5qCRe1t1m5DBrBtdATmlaOFtp0RKtK2g CGF0Z+NQnNTzo2hJoNButtGDPUnOlHqW6lY+Y1cZAEgnQTEW9KgvakcD1quoXJM1Z0xl dB0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FdU0jeVs; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3si9105101pls.185.2022.02.07.03.59.23; Mon, 07 Feb 2022 04:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FdU0jeVs; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235475AbiBETvE (ORCPT + 99 others); Sat, 5 Feb 2022 14:51:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55342 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241415AbiBETvC (ORCPT ); Sat, 5 Feb 2022 14:51:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644090661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iqhdPBrGJMzfcGa86Tjdx0q1TgnB8rdKF3/FSnu8UTs=; b=FdU0jeVsY+t4fHYk4yGJbvigvmDWGntA4ZOgpZz0N0dbcdE1HRpKB1VjNDG89Bs1ZSYEB5 n42gOElN4zO8LnXP41EiUJk0yVcn4r8I/hxUYoZynF3qswOl+I3p6I9ENjxscGyIuXGViA hxlNvISE5VhlgDoUHOU6x5+oxOso1AI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-365-uXZmtSD5PBS_p8DZJmCyrQ-1; Sat, 05 Feb 2022 14:50:58 -0500 X-MC-Unique: uXZmtSD5PBS_p8DZJmCyrQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62EC08519E0; Sat, 5 Feb 2022 19:50:57 +0000 (UTC) Received: from [172.16.176.1] (ovpn-64-2.rdu2.redhat.com [10.10.64.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 111E09329; Sat, 5 Feb 2022 19:50:56 +0000 (UTC) From: "Benjamin Coddington" To: "Trond Myklebust" Cc: linux-nfs@vger.kernel.org Subject: Re: v4 clientid uniquifiers in containers/namespaces Date: Sat, 05 Feb 2022 14:50:55 -0500 Message-ID: <439C77F9-D5AD-4388-B954-3B413C1DF0E2@redhat.com> In-Reply-To: <6ac83db82e838d9d4e1ac10cb13e43c5c12b2660.camel@hammerspace.com> References: <6CEC5101-0512-4082-81F8-BDFEC5B6DF3A@redhat.com> <6ac83db82e838d9d4e1ac10cb13e43c5c12b2660.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 5 Feb 2022, at 13:24, Trond Myklebust wrote: > On Sat, 2022-02-05 at 10:03 -0500, Benjamin Coddington wrote: >> Hi all, >> >> Is anyone using a udev(-like) implementation with >> NETLINK_LISTEN_ALL_NSID? >> It looks like that is at least necessary to allow the init namespaced >> udev >> to receive notifications on /sys/fs/nfs/net/nfs_client/identifier, >> which >> would be a pre-req to automatically uniquify in containers. >> >> I'md interested since it will inform whether I need to send patches >> to >> systemd's udev, and potentially open the can of worms over there.  >> Yet its >> not yet clear to me how an init namespaced udev process can write to >> a netns >> sysfs path. >> >> Another option might be to create yet another daemon/tool that would >> listen >> specifically for these notifications.  Ugh. >> >> Ben >> > > I don't understand. Why do you need a new daemon/tool? > > I have the following entry in /etc/udev/rules.d: > > [trondmy@leira ~]$ cat /etc/udev/rules.d/50-nfs4.rules > ACTION=="add" KERNEL=="nfs_client" ATTR{identifier}=="(null)" > PROGRAM="/usr/sbin/nfs4_uuid" ATTR{identifier}="%c" > > > ...and a very simple script /usr/sbin/nfs4_uuid that reads as follows: > > #!/bin/bash > # > if [ ! -f /etc/nfs4_uuid ] > then > uuid="$(uuidgen -r)" > echo -n ${uuid} > /etc/nfs4_uuid > else > uuid="$(cat /etc/nfs4_uuid)" > fi > echo ${uuid} We're in the same place, but what I see is that when I create a new network namespace with: ip netns add testnamespace Everything in the kernel works up to the point where the userspace udevd never gets a notification. I suspect thats because it hasn't used NETLINK_LISTEN_ALL_NSID, so the kernel's skipping the notification in do_one_broadcast(). If your udev is getting notified of new network namespaces and firing that rule each time, something's different between our setups, and I'd like to figure out what it might be. Ben