Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2011329ybe; Tue, 3 Sep 2019 06:49:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyASzAvIKvJHUV5M4r1ZmxA+wzmHO8wlSBUAj9ftCyhSgHharW0mGicpJ6J0j0XHNjURrWJ X-Received: by 2002:a17:90a:d0c6:: with SMTP id y6mr128204pjw.76.1567518564078; Tue, 03 Sep 2019 06:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567518564; cv=none; d=google.com; s=arc-20160816; b=0KGOsh7xdW/lxun+frwHJEi8T6syRtFMT/V+x/eKSyVFhQkgEhaOuSDJmYgE19dkcR up6eqgOTn+7L3SBYiJyiLgg93gM2Q/bmkpnZwSqgbIwdbgVkMhRvon8Zumta/pVPVf1M htuYiRMYJ1Y0yTjvNHfEILW7XY4L2BAZ3UKaoLVO35jauz+HXqsjzfg4DjNoGPL1O4Mh 9dG6emNe+GiVIWuQPxIH6/OsCoFUPKxssLrd4uVMVRqNJjJMnJ5Uqgas7PK2bOKlkvni iAdDv3LWIt1Tf/xjdHQnZ7SJa3AV/Htjljx9fV6thH8vYrJqIgYgxzwNybvBXKTsBZut dgPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aWe9jVJa4kYCCwwbagBDrCd4LAkXd+dsWayfT9jW62k=; b=dXsnlpoRe5+MEARfmr375d7BltdypqtoxiOyRwF0FJxA6M5Wz3QPPnz2b3mSFdc54t Jv+SyBdQ0faRboAB/BLOufCaYbCcnPH9eM03uPSxHLlscvLHVoLiD/ZKIzaJNiG8JScd H1CuE4nv8k+1DzkN4OlxSDtOa+aSU0Uzga5P2uP6/+p/fIhJSuzXFrI+8SPqYnex4xBZ QhQjKW0aubOT8CIyize7hxC2V6YnuHjTezDZfy+UbeFLOWr2/PqoR0qln6BLcPtWjJcB H2bXG2DMfJ6Ci41VWmmB/LpWCvrNzDRSqe+BmGj/pqM5echTDlCZPReLXw4D3mrHS7i+ AAHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zadara-com.20150623.gappssmtp.com header.s=20150623 header.b="MX/r0m82"; 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 r13si14782296pgn.420.2019.09.03.06.49.06; Tue, 03 Sep 2019 06:49:24 -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; dkim=pass header.i=@zadara-com.20150623.gappssmtp.com header.s=20150623 header.b="MX/r0m82"; 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 S1729296AbfICNtB (ORCPT + 99 others); Tue, 3 Sep 2019 09:49:01 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37100 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729241AbfICNtB (ORCPT ); Tue, 3 Sep 2019 09:49:01 -0400 Received: by mail-io1-f67.google.com with SMTP id r4so20773151iop.4 for ; Tue, 03 Sep 2019 06:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zadara-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aWe9jVJa4kYCCwwbagBDrCd4LAkXd+dsWayfT9jW62k=; b=MX/r0m82vvaq5bEMqxi0mQqjOgniIrub6W1frIfpcdtEtU2k5sR/cXv3+XOhUB5cSn qb0SzqEnKb+vnaPYqMh4m8WKhI4K+SsJvbmhXRv/uepSU2mzf8c9oUcLNdbJi+8kyi9B UOY+/d6NXJCg3O7S8ZhrGGAYp46WnW9UTT8VTwv5fTHYFlaKNvh2Gogy+hmDKhbxPXdH +mEe5+svSO+QHEvYFGMA4s4o3Eog9g1sJGLjLyxeCBtmCTbzrwiK+5Hq52Wj4Kr52K8g 8RtPhKKDkxIP8wlbWJ34WbEo7UEVEksVIpihrDLSgLXjxVVTX2CTyQ1K24hzGeaJKQQv QTIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aWe9jVJa4kYCCwwbagBDrCd4LAkXd+dsWayfT9jW62k=; b=LP0+8PwKiN7e7T5xUqftDclfQi06K2Vd9yEYAF27TyWVlx5ez1xK8bRSc8UJ56jxw1 NljokgnGGXPys9opUDpZHJOtSgQIvH56cVloVuwxHDd1nFa/xoV8NFQSovq7xXNE+5y9 W2LgzJMQKDyCTX/6F7Nw3kkkyrAIaP1Vo3QOD3njhNgqpg4yOhww/0xDhYluprTb6JkL qLetn64qqsqyQIeoIMc65vT7MM3ZgfT6hDO/XRFPzCz8mBv8r8DsiTO7FTGPfqxbIUnc SIUQDBNtFNPwC3PHblT7YWSdEdOWyr057bwMOu4+h7ayC+Nk+YNILSPwsGTtRkjePoMT vAZw== X-Gm-Message-State: APjAAAXyBIVyop/gXjQSOUZtErjR/CFh3bw57AqjfFP7xsf0PrmCCIBm RL6zI5FMitSLSeTMdPMlxcsUarPdGXMeDDHGNEDA4w== X-Received: by 2002:a5d:8788:: with SMTP id f8mr4829794ion.20.1567518540174; Tue, 03 Sep 2019 06:49:00 -0700 (PDT) MIME-Version: 1.0 References: <1566406146-7887-1-git-send-email-alex@zadara.com> <20190826133951.GC22759@fieldses.org> <20190827205158.GB13198@fieldses.org> <20190828165429.GC26284@fieldses.org> <20190830195443.GC5053@fieldses.org> In-Reply-To: <20190830195443.GC5053@fieldses.org> From: Alex Lyakas Date: Tue, 3 Sep 2019 16:48:48 +0300 Message-ID: Subject: Re: [RFC-PATCH] nfsd: when unhashing openowners, increment openowner's refcount To: "J. Bruce Fields" Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org, Shyam Kaushik Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Bruce, On Fri, Aug 30, 2019 at 10:54 PM J. Bruce Fields wrote: > > 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. Thanks for your suggestion.The superblock approach works very well for us. Initial patch is on its way. Thanks, Alex. > > --b.