Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp368723ybj; Wed, 6 May 2020 20:20:54 -0700 (PDT) X-Google-Smtp-Source: APiQypIUuurcYSwu7HU8ASdSrWgm5Dd3hvGH/cD8cbNRUp7OJGy2BhdWMFZgtzXgygX3ggCZM4yS X-Received: by 2002:a17:906:72c8:: with SMTP id m8mr10551278ejl.318.1588821654072; Wed, 06 May 2020 20:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588821654; cv=none; d=google.com; s=arc-20160816; b=gLI+g2XdxDueJrnIwH/qcJ7TzAN0WyqZX2OBhIEInrEFymD12d5YvfVTCh+s6dQLYH /LojC+fJIBYM0eMY0h+tjt4WVQeJqvYV733JhGXqucmRhUmgcB8lZCJEvnrnh7Obdv8W x7gFJSnsY9qNWY540Y5bBr/OS2qiHPBOzv9w+NnAGbL+tVLXCA4IAgFq4Abbamx6gmVW 8G3JjZlwoQu1EugoOcz+wKUVu8lZWw0GsNc2qg2bdpqVPYLbdCwYID1ChPxkUElnfeXi OUsrrMNidqGQTQMlLAdJ2YEurJQm42VC6ypn0AudB12St9QHMs6E3S+qCV7oQpRLey1P CxfA== 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=bxDte0BhUWzJCX34AbdL+g+HunnQafNEB9PTdc37YXs=; b=L4RB2+dAisccB/92Jpwrgt+85YkxCmhVEBuB3baoty4vPbAuOm5Wa4njkMrsF5NtXi 3dXIVSZ4wqv91W0A9d/RNeO7v2m7nOrh3d6y1VEG7mZJ3mAU8st61xt7zhemYih/EfBU jDq5JdmXPyO/vsrrzCh8siF9gIPV7TafesKfNCPqT/MAj+rACVBrELzDAmDzCCruGOkl F6Gt3i10XFfongLtK/xKss7DXyR643+G8CYZOuC7JEzzx810AwFusxLGxSIsxym6lwTm fBUEe8yh/iAYSO00Uc5USa5MSQuAvxPYoBNOWUYPMatq+54HuSthy/YFG1nDoYNxTJeE jnQA== 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 o15si2314495eju.289.2020.05.06.20.20.19; Wed, 06 May 2020 20:20:54 -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 S1728299AbgEGBcE (ORCPT + 99 others); Wed, 6 May 2020 21:32:04 -0400 Received: from fieldses.org ([173.255.197.46]:48322 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728294AbgEGBcE (ORCPT ); Wed, 6 May 2020 21:32:04 -0400 Received: by fieldses.org (Postfix, from userid 2815) id AA86B26D5; Wed, 6 May 2020 21:32:03 -0400 (EDT) Date: Wed, 6 May 2020 21:32:03 -0400 To: Kenneth D'souza Cc: linux-nfs@vger.kernel.org, bfields@redhat.com, agaikwad@redhat.com Subject: Re: [PATCH] nfsd4: Make "info" file json compatible. Message-ID: <20200507013203.GD21307@fieldses.org> References: <20200501062230.19693-1-kdsouza@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200501062230.19693-1-kdsouza@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 Fri, May 01, 2020 at 11:52:30AM +0530, Kenneth D'souza wrote: > Currently the output returned by client_info_show() is not > pure json, fix it so user space can pass the file properly. Gah, I said JSON, but the promise was that these files would be YAML, which I believe is a superset of JSON. I'd prefer not to make major backwards-incompatible changes. --b. > > Signed-off-by: Kenneth D'souza > Signed-off-by: Achilles Gaikwad > --- > fs/nfsd/nfs4state.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index c107caa56525..f2a14f95ffa6 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -2341,19 +2341,24 @@ static int client_info_show(struct seq_file *m, void *v) > if (!clp) > return -ENXIO; > memcpy(&clid, &clp->cl_clientid, sizeof(clid)); > - seq_printf(m, "clientid: 0x%llx\n", clid); > - seq_printf(m, "address: \"%pISpc\"\n", (struct sockaddr *)&clp->cl_addr); > - seq_printf(m, "name: "); > + seq_printf(m, "{\n"); > + seq_printf(m, "\t\"clientid\": \"0x%llx\",\n", clid); > + seq_printf(m, "\t\"address\": \"%pISpc\",\n", (struct sockaddr *)&clp->cl_addr); > + seq_printf(m, "\t\"name\": "); > seq_quote_mem(m, clp->cl_name.data, clp->cl_name.len); > - seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion); > + seq_printf(m, ", "); > + seq_printf(m, "\n\t\"minor version\": %d,\n", clp->cl_minorversion); > if (clp->cl_nii_domain.data) { > - seq_printf(m, "Implementation domain: "); > + seq_printf(m, "\t\"Implementation domain\": "); > seq_quote_mem(m, clp->cl_nii_domain.data, > clp->cl_nii_domain.len); > - seq_printf(m, "\nImplementation name: "); > + seq_printf(m, ", "); > + seq_printf(m, "\n\t\"Implementation name\": "); > seq_quote_mem(m, clp->cl_nii_name.data, clp->cl_nii_name.len); > - seq_printf(m, "\nImplementation time: [%lld, %ld]\n", > + seq_printf(m, ", "); > + seq_printf(m, "\n\t\"Implementation time\": \"[%lld, %ld]\"\n", > clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec); > + seq_printf(m, "}\n"); > } > drop_client(clp); > > -- > 2.21.1