Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp55001yba; Wed, 15 May 2019 18:49:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhz1l8iGWZ9/uOak6LOkkYidGIJb/F3LXNHjCnP8iaZ6gqW2ZhsN+oxUyJ6WZu6kYHklF3 X-Received: by 2002:a62:53:: with SMTP id 80mr22999900pfa.183.1557971394049; Wed, 15 May 2019 18:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557971394; cv=none; d=google.com; s=arc-20160816; b=DVcdVvkvrLiwpe3I7ZUhwnReH+E4qFu5lCH4+jPjaXZUOFAQZgDWdsJr6xg1GXk90V F9in3s1qTjNz/r2QtLjle/yyIL8+4ufgX+eeysGASMM0W51tPcfz24yrL/nJv+VSPONJ RHO1hcJwJca7vuVc8eLXFJwbNKzVLzkB3AsNIkoqw89KNW3gZHJZcD5Eyj6UYmfYbgjR wxoIZv5LUBO9SSv92NZVhjcD1nPOfa2fkpD2N1b05G9HUztK1s1/dtCrNPLFUG87bXpd yijXTaMrZGsqdY0LsG2r2RBKswWMMlTuLShBTHTPS3Z6C5z6tXWWKTeJ21gtTeLF90Ql mSrw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ZaBqm9TUcpJSsIPhhrPkNNMU9SWsa31AKt+1DoIMlk8=; b=VzQwPKtn2ki+P109Gx7tmRQSjnEjn/paBHKrUYbDPvfZ7qGYDc4CU2dNGbUdKqCObB 190eFzCUh//576MLwEPQOTnCrbZm1CLiE8uaOBSsGmftcD+flihb8cVU3sXmGxLnlGR8 zE/aNWvAVKmN58QEN7S8CdoUACdYTHimW8awFznub+sDA31j6NI97Y/v0qJB/CkqgTdK /6kxON6R1T4b/3x4IeAkkhy9oSjAWQA9ScLK5c5Qf9qYvm7oPjNVNxAXDdMhjmvr4AOv x3PN/ejAFL2SiNympkg7uzKWpIhwAdgEsYjybykAJ/16F8XpFGTfDw6/3a378DnN8Lbm eL2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si3707861pfn.136.2019.05.15.18.49.40; Wed, 15 May 2019 18:49:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727526AbfEPBqf (ORCPT + 99 others); Wed, 15 May 2019 21:46:35 -0400 Received: from fieldses.org ([173.255.197.46]:33026 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbfEPAke (ORCPT ); Wed, 15 May 2019 20:40:34 -0400 Received: by fieldses.org (Postfix, from userid 2815) id CC88DBCE; Wed, 15 May 2019 20:40:32 -0400 (EDT) Date: Wed, 15 May 2019 20:40:32 -0400 From: "J. Bruce Fields" To: Andreas Dilger Cc: Jeff Layton , "J. Bruce Fields" , linux-nfs , linux-fsdevel@vger.kernel.org, abe@purdue.edu, lsof-l@lists.purdue.edu, util-linux@vger.kernel.org Subject: Re: [PATCH 08/10] nfsd4: add file to display list of client's opens Message-ID: <20190516004032.GA16284@fieldses.org> References: <1556201060-7947-1-git-send-email-bfields@redhat.com> <1556201060-7947-9-git-send-email-bfields@redhat.com> <20190425201413.GB9889@fieldses.org> <7F460FEA-BD69-4559-926C-5C1B0CF90E3C@dilger.ca> <20190426011804.GA12457@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190426011804.GA12457@fieldses.org> 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 Thu, Apr 25, 2019 at 09:18:04PM -0400, J. Bruce Fields wrote: > On Thu, Apr 25, 2019 at 11:14:23PM +0200, Andreas Dilger wrote: > > On Apr 25, 2019, at 10:14 PM, J. Bruce Fields wrote: > > > > > > On Thu, Apr 25, 2019 at 02:04:59PM -0400, Jeff Layton wrote: > > >> More bikeshedding: should we have a "states" file instead of an "opens" > > >> file and print a different set of output for each stateid type? > > > > > > Sure. The format of the file could be something like > > > > > > open rw -- ... > > > lock r 0-EOF ... > > > deleg r > > > > > > I wonder if we could put owners on separate lines and do some > > > heirarchical thing to show owner-stateid relationships? Hm. That's > > > kind of appealing but more work. > > > > My suggestion here would be to use YAML-formatted output rather than > > space/tab separated positional fields. That can still be made human > > readable, but also machine parseable and extensible if formatted properly. > > Well, anything we do will be machine-parseable. But I can believe YAML > would make future extension easier. It doesn't look like it would be > more complicated to generate. It uses C-style escaping (like \x32) so > there'd be no change to how we format binary blobs. > > The field names make it a tad more verbose but I guess it's not too bad. OK, I tried changing "opens" to "states" and using YAML. Example output: - 0x020000006a5fdc5c4ad09d9e01000000: { type: open, access: rw, deny: --, superblock: "fd:10:13649", owner: "open id:\x00\x00\x00&\x00\x00\x00\x00\x00\x0046��QH " } - 0x010000006a5fdc5c4ad09d9e03000000: { type: open, access: r-, deny: --, superblock: "fd:10:13650", owner: "open id:\x00\x00\x00&\x00\x00\x00\x00\x00\x0046��QH" } - 0x010000006a5fdc5c4ad09d9e04000000: { type: deleg, access: r, superblock: "fd:10:13650" } - 0x010000006a5fdc5c4ad09d9e06000000: { type: lock, superblock: "fd:10:13649", owner: "lock id:\x00\x00\x00&\x00\x00\x00\x00\x00\x00\x00\x00" } The parser Andreas suggested (https://yaml-online-parser.appspot.com/) accepts these. It also thinks strings are always in a unicode encoding of some kind, which they aren't. The owners are arbitrary series of bytes but I'd like at least any ascii parts to be human readable, and I'm a little stuck on how to do that. --b.