Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp728124pxu; Wed, 7 Oct 2020 14:25:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Ck2A+aP9I4w3mvuFzYAgUfZByBU0CKxz5hKJS9CoxaBOZHDQI0Lf/lDwax8nBL4fE//N X-Received: by 2002:a17:906:a00c:: with SMTP id p12mr5263477ejy.10.1602105945825; Wed, 07 Oct 2020 14:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602105945; cv=none; d=google.com; s=arc-20160816; b=yCUxPVd1cChQERsnI9vWuyB2rJpfV+5CvE376hEvFE+hrGX47Agvo/zc3gLK150oPP nMLrqQ6v/BFUreR8Zllgukq2yUlBMjIq83iogHpFhW05hB3TOJWwCrrHqo73etqZtUiW v3MjdqwqdIvrCBr0RchC/d30XSDS85zej2N5S3bmQXax7GZIUG/mqLG+7fDD7adlAsXv MVUdcEKVVNkcQyO5f0Atw3WTCHZhyuwmrLRlyBDZ7RyZc+fScORqYBJIseu0BkPwQv8q 6EZ+BzuZAWZihbAVL3QwVaOWsm+7D9/8Vw4VWBAMJdcspOusQDznBz42QU0bY0bxLZ14 dTpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:from:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date :dkim-signature:dkim-filter; bh=GMBTVl4PWqRFyeyu/0FnGKpJkOooQD/TNilDbG9X3Ok=; b=ZQgrW38NbYo6T6uIQiN/W8TjMiST6w6mM2cQYdrx/Z6sthK9imzTTe1LiMjgYI9bJh xl8vgWEx/M8vlL9ZbkBvdF9Nb9lgHqMKcRiOSa/GAyulTfeTIIl8mJIe3ltHXliiAPMB 8HgS/jpSVUu37KYPPfKctYpCoGJsk0MbGfcQ7uopR+YubVrHZ5IZfAmGvna2ZDihRPLN CLE/5Cs1pRKUHkvhG4xW+CnBR0xE9Zcu/aVyDshHnEdgld8X0JpSQlhtrRK4qz8xrnR6 FaOvz71/GIXzx4pP1ddYF037wTNwo6e6ML3eKtqWQ5UwxvCdrrlOVJQt9SknrNykKLHE nSQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=aZKkDgNC; 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 bu8si2085076ejb.76.2020.10.07.14.25.17; Wed, 07 Oct 2020 14:25:45 -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; dkim=pass header.i=@fieldses.org header.s=default header.b=aZKkDgNC; 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 S1728172AbgJGVZB (ORCPT + 99 others); Wed, 7 Oct 2020 17:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbgJGVZB (ORCPT ); Wed, 7 Oct 2020 17:25:01 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EACA0C061755 for ; Wed, 7 Oct 2020 14:25:00 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 05FA569C3; Wed, 7 Oct 2020 17:25:00 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 05FA569C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1602105900; bh=GMBTVl4PWqRFyeyu/0FnGKpJkOooQD/TNilDbG9X3Ok=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=aZKkDgNC/Runr/foY5VwXc0ouTDBAL620aJhMSBjOhTmZKDwMk19MIath80JqdktF gncLRXjNAteaiRHeA8sw9fv5Uicajf9BwD8b5//EaO0K7diWlEkgFkSiX8wdzQbuRK tRqTqLKhczxz3Sl7G+kelNavSSYXSEEmjKhbuWyQ= Date: Wed, 7 Oct 2020 17:25:00 -0400 To: trondmy@kernel.org Cc: Anna Schumaker , linux-nfs@vger.kernel.org Subject: Re: [PATCH 2/2] NFSv4: Use the net namespace uniquifier if it is set Message-ID: <20201007212500.GI23452@fieldses.org> References: <20201007210720.537880-1-trondmy@kernel.org> <20201007210720.537880-2-trondmy@kernel.org> <20201007210720.537880-3-trondmy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007210720.537880-3-trondmy@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Oct 07, 2020 at 05:07:20PM -0400, trondmy@kernel.org wrote: > From: Trond Myklebust > > If a container sets a net namespace specific uniquifier, What you're actually checking is if nn->nfs_client != NULL, and that's pretty much always true. (The only time it's NULL is an allocation failure in some initialization code, I think.) > + struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id); > + struct nfs_netns_client *nn_clp = nn->nfs_client; > + const char *id; > + size_t len; > + > buf[0] = '\0'; > + > + if (nn_clp) { Are you sure you don't mean if (nn_clp->identifier) ? I think that's how you tell if someone's set it. --b. > + rcu_read_lock(); > + id = rcu_dereference(nn_clp->identifier); > + if (id && *id != '\0') > + len = strlcpy(buf, id, buflen); > + rcu_read_unlock(); > + if (len) > + return len; > + } > + > if (nfs4_client_id_uniquifier[0] != '\0') > return strlcpy(buf, nfs4_client_id_uniquifier, buflen); > return 0; > @@ -6034,7 +6051,7 @@ nfs4_init_nonuniform_client_string(struct nfs_client *clp) > 1; > rcu_read_unlock(); > > - buflen = nfs4_get_uniquifier(buf, sizeof(buf)); > + buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf)); > if (buflen) > len += buflen + 1; > > @@ -6081,7 +6098,7 @@ nfs4_init_uniform_client_string(struct nfs_client *clp) > len = 10 + 10 + 1 + 10 + 1 + > strlen(clp->cl_rpcclient->cl_nodename) + 1; > > - buflen = nfs4_get_uniquifier(buf, sizeof(buf)); > + buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf)); > if (buflen) > len += buflen + 1; > > -- > 2.26.2