From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 565C4C3A59B for ; Fri, 30 Aug 2019 19:54:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E4ED23429 for ; Fri, 30 Aug 2019 19:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbfH3Tyo (ORCPT ); Fri, 30 Aug 2019 15:54:44 -0400 Received: from fieldses.org ([173.255.197.46]:51296 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbfH3Tyo (ORCPT ); Fri, 30 Aug 2019 15:54:44 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 011541CB4; Fri, 30 Aug 2019 15:54:44 -0400 (EDT) Date: Fri, 30 Aug 2019 15:54:43 -0400 From: "J. Bruce Fields" To: Alex Lyakas Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org, Shyam Kaushik Subject: Re: [RFC-PATCH] nfsd: when unhashing openowners, increment openowner's refcount Message-ID: <20190830195443.GC5053@fieldses.org> References: <1566406146-7887-1-git-send-email-alex@zadara.com> <20190826133951.GC22759@fieldses.org> <20190827205158.GB13198@fieldses.org> <20190828165429.GC26284@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Aug 29, 2019 at 09:12:49PM +0300, Alex Lyakas wrote: > Would moving this code into the "unlock_filesystem" infrastructure be > acceptable? Since the "share_id" approach is very custom for our > usage, what criteria would you suggest for selecting the openowners to > be "forgotten"? Have you looked at what unlock_filesystem()? It's just translating the given path to a superblock, then matching that against inodes in nlmsvc_match_sb(). It's a little more complicated for nfs4_files since they don't have a pointer to the inode. (Maybe it should.) You can see how I get around this in e.g. fs/nfsd/nfs4state.c:nfs4_show_lock(). A superblock isn't the same thing as an export, thanks to bind mounts and subdirectory exports. But if the goal is to be able to unmount, then a superblock is probably what you want. --b.