Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4067569ybz; Mon, 20 Apr 2020 15:05:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8/3u9p8/ulp1hYoZvJDdKHQDaO70nBovSw/MROfs+4xxFv/jyHUJw9g5XgMtTW40HgkYx X-Received: by 2002:a17:906:b896:: with SMTP id hb22mr4688532ejb.209.1587420301749; Mon, 20 Apr 2020 15:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587420301; cv=none; d=google.com; s=arc-20160816; b=RhNf/okCixYJwzkydvILXLfOrVHVW/Sl5HQrmfoxNhiWgx99MZZRrKg44QnftP6D+M gCE7H+yVLh01qq4UGXeM5nyaZwKVOx3NHepLZCbyydDoehN70zg5t6vp9M6/ZHBbW4Px bATLYwncCKyFMUdmgjxMn4oDGVIYJSj4tFX8z4Nw5RoIu8yOO1il110PxtBhBsZSycHW ghXVOGTB46dRNhhY3POg9LNFC1MAtx5o8aifeY1EAMIp3LPp0ebhvW1CePRMhJvAOsyo G4nNNhYs5Ok1oU8utbm0voFkyiUWXVecQXeL7bb5+SKUpB0UwywOcoaWFciAXo4U/5w9 9SRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ss616KwlQKJZicIxJG3zAvlJwyYcJCGrBpt9IRLXe2E=; b=X78DdV/dtPZgZDqNPyy1nE6lP53DTwKjvn6FjLwTmXvqNoYbOz7nG4jGql2LJil+ki DVNjXKsqrAcrwVyNW5Dw866j0ySoAU8GKU9hyQ2qP6jV1RCCUK/m2Egsq7pGq5yeZF6w LqZoZXQFfZ3mK0Qj3q174blBlaRl54DYY3kyAqIl2qFo2xiphSg/9e9R8uGZ5Zg1r2qU 80QtTVyo9V0cfyjgd6BitB0XaHAixUuuKE4L9OzaVCXyWudKjY2v2Pw64YH/lJ9koe87 /CxR+Pg/XPYvqRQuGVQbZ44zMdeqlw0hOZBNUS3+w1pgQ4a0p0sgwYDMaaC0UvrG49ou PsGw== 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 q24si271220ejz.458.2020.04.20.15.04.28; Mon, 20 Apr 2020 15:05:01 -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 S1726650AbgDTWED (ORCPT + 99 others); Mon, 20 Apr 2020 18:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgDTWEC (ORCPT ); Mon, 20 Apr 2020 18:04:02 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00::f03c:91ff:fe50:41d6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3C9EC061A0C for ; Mon, 20 Apr 2020 15:04:02 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id ED4A5C53; Mon, 20 Apr 2020 18:04:01 -0400 (EDT) Date: Mon, 20 Apr 2020 18:04:01 -0400 From: "J. Bruce Fields" To: Achilles Gaikwad Cc: linux-nfs@vger.kernel.org, trondmy@hammerspace.com, kdsouza@redhat.com Subject: Re: [PATCH v3] nfsd4: add filename to states output Message-ID: <20200420220401.GB3571@fieldses.org> References: <20200420125031.GA44720@nevermore.foobar.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200420125031.GA44720@nevermore.foobar.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Apr 20, 2020 at 06:20:31PM +0530, Achilles Gaikwad wrote: > Add filename to states output for ease of debugging. Thanks! The results may be surprising for disconnected dentries. E.g., start a "tail -f" on a file on an NFS export, then reboot the server and give the client a chance to recover, and then look at /proc/fs/nfsd/clients, and you'll just see filename: "/" But, I suppose it's still nice to print the pathname when it's available. The one improvement I can think of is to print something like "" in that case. I'm not sure where that logic would go. --b. > > Signed-off-by: Achilles Gaikwad > Signed-off-by: Kenneth Dsouza > --- > fs/nfsd/nfs4state.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index e32ecedece0f..27338640959d 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -2404,6 +2404,11 @@ static void states_stop(struct seq_file *s, void *v) > spin_unlock(&clp->cl_lock); > } > > +static void nfs4_show_fname(struct seq_file *s, struct nfsd_file *f) > +{ > + seq_printf(s, "filename: \"%pD2\"", f->nf_file); > +} > + > static void nfs4_show_superblock(struct seq_file *s, struct nfsd_file *f) > { > struct inode *inode = f->nf_inode; > @@ -2449,6 +2454,8 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) > > nfs4_show_superblock(s, file); > seq_printf(s, ", "); > + nfs4_show_fname(s, file); > + seq_printf(s, ", "); > nfs4_show_owner(s, oo); > seq_printf(s, " }\n"); > nfsd_file_put(file); > @@ -2480,6 +2487,8 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st) > nfs4_show_superblock(s, file); > /* XXX: open stateid? */ > seq_printf(s, ", "); > + nfs4_show_fname(s, file); > + seq_printf(s, ", "); > nfs4_show_owner(s, oo); > seq_printf(s, " }\n"); > nfsd_file_put(file); > @@ -2506,6 +2515,8 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st) > /* XXX: lease time, whether it's being recalled. */ > > nfs4_show_superblock(s, file); > + seq_printf(s, ", "); > + nfs4_show_fname(s, file); > seq_printf(s, " }\n"); > > return 0; > @@ -2524,6 +2535,8 @@ static int nfs4_show_layout(struct seq_file *s, struct nfs4_stid *st) > /* XXX: What else would be useful? */ > > nfs4_show_superblock(s, file); > + seq_printf(s, ", "); > + nfs4_show_fname(s, file); > seq_printf(s, " }\n"); > > return 0; > -- > 2.25.3