From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fieldses.org ([173.255.197.46]:59572 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728281AbeLJTXL (ORCPT ); Mon, 10 Dec 2018 14:23:11 -0500 Date: Mon, 10 Dec 2018 14:23:10 -0500 From: "J. Bruce Fields" To: Jeff Layton Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: listing knfsd-held locks and opens Message-ID: <20181210192310.GC2925@fieldses.org> References: <20181210174720.GA2925@fieldses.org> <0ff22d33d5d7d2b3fad241ebb2aa0e5c5cb70396.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ff22d33d5d7d2b3fad241ebb2aa0e5c5cb70396.camel@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Dec 10, 2018 at 01:12:31PM -0500, Jeff Layton wrote: > On Mon, 2018-12-10 at 12:47 -0500, J. Bruce Fields wrote: > > We've got a long-standing complaint that tools like lsof, when run on an > > NFS server, overlook opens and locks held by NFS clients. > > > > The information's all there, it's just a question of how to expose it. > > > > Easiest might be a single flat file like /proc/locks, but I've always > > hoped we could do something slightly more structured, using a > > subdirectory per NFS client. > > > > Jeff Layton looked into this several years ago. I don't remember if > > there was some particular issue or if he just got bogged down in VFS > > details. > > > > I think I had a patch that generated a single flat file for locks, but > you wanted to present a directory or file per-client, and I just never > got around to reworking the earlier patch. Oh, OK, makes sense. > That sounds like a great start. Some ideas: > > The locks file could also list delegations and layouts, but it might be > good to do them in separate files. That would make it cleaner to display > info that is only relevant to those types (recall info, in particular). > > You might also consider adding a v4-specific info file. Show things like > "when was last lease renewal"? Yes, good ideas. I hope this could be expandable in such a way that we don't need all of that at the start. I also had some idea that we might eventually also benefit from some two-way communication. But the only idea I had there was some sort of "destroy this client now" operation, which is probably less important for NFSv4 state, since it gets cleaned up automatically on lease expiry. --b.