Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1164696ybl; Fri, 30 Aug 2019 12:55:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC3HmjOv4+eTDsYJcPT2bj/9AFFABQnhzgeMay3LiP3rIndQmFkqd1vdwXS8/hnVympdpZ X-Received: by 2002:a62:641:: with SMTP id 62mr19906110pfg.55.1567194912592; Fri, 30 Aug 2019 12:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567194912; cv=none; d=google.com; s=arc-20160816; b=S6brt/qgXRDgOxu6oNYGRqQZNz623wBhM4gBMAZY1q8Ju4wLDtItU4RFWcFD8PQgiS eTFML28UXhEmw9LsSlxPh3N8eihS4HCxvzQCeNi7TwP/nHCm+hWF69p+DJCc5KP4Pp99 p5/J8X3AdfBvE91KioUSmQdy35fhudrAOam6lpwYjseNvQktL4pKVJqLsCghV+RfFtT5 3esHIn8QM3jmawaarKrzbQ/LfXRDjrJRXp/GAWOCcZrAPCs22usZkpsn/CqicWc2PtJ9 e7DRN1vOfm2ilsb5/GVXuz9EZy9V7MPi3GJn4FnsU0LGLxehOOmV+kzs5pu11BQEObyD pqfA== 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=XhVg35wS3I6JAxoYahm9cWzhJ9u0qw9GJHfJcZIE3i8=; b=JaeoEiGkVebQat2hiZtIsaq4C4QbCI7bJxG2QrNif+tmcQhVcSU0gpMAV/6iQ/LEod rj4R1MQG+giOiQ0ngvPJKqBoxa6RfEsiXutfJfFCvYUy3MoGMXb3/P/qSSlXxf1usKjv t9LwtO7MyLr2MBIaOj+Xv+h5PHctgFq/F9mglMeq0ayQs1+XFvB5UM9RYOo35GX1xPYS A9vxadji02+3TSZhvR9jTFYnLPK5FimwNQ8annRq+w3osow+WIJz42wSuXwV6aeGOo4z ASE9Fmp5ebqiVLWKfX6zKJ6A0Gh0nWrmylHqpgZQwvH98FT3IVA4EoCItxBnLRGTGqmm x5+Q== 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 q24si5325638plr.416.2019.08.30.12.54.46; Fri, 30 Aug 2019 12:55:12 -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 S1728031AbfH3Tyo (ORCPT + 99 others); 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.