Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp872244ybk; Wed, 13 May 2020 15:41:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlv9o1Z0rlMFFmZA8ijtS5qP/1D932OMjrkeqWIsIBONmAQx/2YUnyOK52IPn1TW9CuWa+ X-Received: by 2002:a50:f017:: with SMTP id r23mr1600251edl.290.1589409663213; Wed, 13 May 2020 15:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589409663; cv=none; d=google.com; s=arc-20160816; b=l7EZFFtK7UB61h4UNWTUl4mJ6yM+SmK4Lt6fy8QTQ3vTkBAdKLLxe0PgAPeNF1Qr/W rPPxMepNXVPNuNPk4tMQfGkjI1VD5xgGidNgOkt9S/uMl/dPF+D/Q8zrwLH74GYn6FdU H7Wyba6/TPE+3Lhe0w8GhxDZVmo2FcW7SmSZn9DPub5RVyprV+EG5tag1jW+V4dF7El9 2MXzIQwdN59MDSab7PsWo5OkRwKhE1GX+ANPI+Sw9W/U/+XbjCCDtYRn3YdySVLzzlrQ +SdoTIzsVyKDzH/oVuiftLPIWl0bzPEcU9Br9AFEdw4PPB3Uw+bq5+TQQg4ftYSSI2lb 4LaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=DKuSj9otM4EaotNbwblvmuaR2Ov7ewcpw2veGKYM4tk=; b=r7r/cgTKUfAwMR0L5fvQ3+RXdVQE7iJW2C1VIEit1M5Wh+1nL3hsqGgrrmdeNbBPwA 0rXC5ojt3gRIk5OgEdAS3b/UHUM9V/g6cXJviLPeeTpwo+NUDx44OsLP3aRvZZeAAxH0 PVIUB4jKXyaSYGKo3KRBq2ZUg78RNn6GwxI1Bflwuzi6TL8yCthKiMcKTAqrSxoFIKdR bX40bE7eQTAnm1nws9NMGQehLB+v8t9cwIi4cGMv57ywOZODk32YlYDhI8mTD0+lJO9u q62rphmRg3UBLosvnC3BTVhNJi0LPqZdZquGdFiwUT7JzJFXS5/s84SvKUyRPpLDHGA5 qMZA== 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 a6si829660ejy.11.2020.05.13.15.40.39; Wed, 13 May 2020 15:41: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 S1728547AbgEMWke (ORCPT + 99 others); Wed, 13 May 2020 18:40:34 -0400 Received: from fieldses.org ([173.255.197.46]:57804 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbgEMWke (ORCPT ); Wed, 13 May 2020 18:40:34 -0400 Received: by fieldses.org (Postfix, from userid 2815) id C5D1D7EC; Wed, 13 May 2020 18:40:33 -0400 (EDT) Date: Wed, 13 May 2020 18:40:33 -0400 To: "J. Bruce Fields" Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org Subject: Re: [PATCH] SUNRPC: 'Directory with parent 'rpc_clnt' already present!' Message-ID: <20200513224033.GA1415@fieldses.org> References: <1589409520-1344-1-git-send-email-bfields@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589409520-1344-1-git-send-email-bfields@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, May 13, 2020 at 06:38:40PM -0400, J. Bruce Fields wrote: > From: "J. Bruce Fields" > > Each rpc_client has a cl_clid which is allocated from a global ida, and > a debugfs directory which is named after cl_clid. > > We're releasing the cl_clid before we free the debugfs directory named > after it. As soon as the cl_clid is released, that value is available > for another newly created client. > > That leaves a window where another client may attempt to create a new > debugfs directory with the same name as the not-yet-deleted debugfs > directory from the dying client. Symptoms are log messages like > > Directory 4 with parent 'rpc_clnt' already present! This also cleared up a "file-max limit 199277 reached" warning, which suggests to me a leak in an error path somewhere (I think everything's supposed to work normally even if debugfs file createion fails), but I don't see it. --b. > > Fixes: 7c4310ff5642 "SUNRPC: defer slow parts of rpc_free_client() to a workqueue." > Signed-off-by: J. Bruce Fields > --- > net/sunrpc/clnt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c > index 8350d3a2e9a7..4a7efc00fd83 100644 > --- a/net/sunrpc/clnt.c > +++ b/net/sunrpc/clnt.c > @@ -889,6 +889,7 @@ static void rpc_free_client_work(struct work_struct *work) > * here. > */ > rpc_clnt_debugfs_unregister(clnt); > + rpc_free_clid(clnt); > rpc_clnt_remove_pipedir(clnt); > > kfree(clnt); > @@ -910,7 +911,6 @@ rpc_free_client(struct rpc_clnt *clnt) > xprt_put(rcu_dereference_raw(clnt->cl_xprt)); > xprt_iter_destroy(&clnt->cl_xpi); > put_cred(clnt->cl_cred); > - rpc_free_clid(clnt); > > INIT_WORK(&clnt->cl_work, rpc_free_client_work); > schedule_work(&clnt->cl_work); > -- > 2.26.2