Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1009712ybl; Wed, 28 Aug 2019 08:22:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxe9zIK/pcA4K8+QDnpqdd9hvN2xndkv33WcsvaZtNuyVP/AxNFr09FYHrjN8hsFHeI7kZK X-Received: by 2002:a65:4507:: with SMTP id n7mr3822772pgq.86.1567005749845; Wed, 28 Aug 2019 08:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567005749; cv=none; d=google.com; s=arc-20160816; b=A6ApF2TpE8gd2BJTAeCy84cqmXa/4QTXYsgOx8imwMKJSd/6qElX5ueKR12yNUdw29 8WZ8tKt9AIKsoubBLszKEkX9VBXg3fosptomkj9J4yWdY2SaPRm6jaNEKwcrbFgAhXG/ 0bRcG/MMu8WZqJ9zbfgGDiiSC1Bc6LyAKvL6qBm8Y0SD2diZu7bw5q7DtxGuLOM6r+3f DpiqOwyGAxKK/ixb4K9x/HQqxQQ67p/nmCU8xrYtvDaLzs5CprSJ9p8ECv/mmb3wl6cM 61JZBVYQfJXALhF/4Xqzryj2JYXgT1J+26MXtWn17wXSHGpBkXKKwDPBMOg47ZaYbAZX 716g== 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=V7oYmcP6SBUoeMA1SCFbG9LB8sh7NsVOLH35iprwP0Y=; b=KoYZ4/DX89fdUYim3sfG7lUkOWxgmbJNWvdo8IIIbCGcD2pY8nmYJXCmVcGYZN46R3 OAEH0E0ooORiswnDEiAxT4aTbYxLE/7u0U2arxxqrmNGxc1GY9pMY1FYLiJGHl4MpdfD iUiJEjI1FIAku2/jt60VGCqRoR5o33Uwgj+vslq6bKhCXQn5DDNsbEJq7FD3le+Egyzw Ao9X9FlC+e2ukZGWibqE2n235ChhmaKDKsK3VYSDGf6pOKfmOcrne1slTZ6LjQEJbszN qHDxSSrkD+5jnqmPuZiAARELzP1pzu9On318vDJgDhh7MotohAYPcj97iy32eFgm9ole ESkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zadara-com.20150623.gappssmtp.com header.s=20150623 header.b=XrymNvHU; 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 g2si2874251pfq.160.2019.08.28.08.22.13; Wed, 28 Aug 2019 08:22:29 -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=XrymNvHU; 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 S1726709AbfH1PUf (ORCPT + 99 others); Wed, 28 Aug 2019 11:20:35 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:33234 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbfH1PUe (ORCPT ); Wed, 28 Aug 2019 11:20:34 -0400 Received: by mail-io1-f67.google.com with SMTP id z3so382354iog.0 for ; Wed, 28 Aug 2019 08:20:34 -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=V7oYmcP6SBUoeMA1SCFbG9LB8sh7NsVOLH35iprwP0Y=; b=XrymNvHUK81ywqUCULvdvIemlAo+eOmGtcgN7E6+5qdEJO4AH68DIO800V5OWzE6GT y/R9RvoUcocfV+O4iVcKXCzW5iiJ/l9x2qO9aiqwIiDaT8amXl04p6iCUHjEl1CLpD8L PXXWKMOZV8P7LimVKw1CQhMVXMJMPItLG6itvk5gig4YU5nuEzHnwz6eRGkIHShTUAkp Yno4hoaGr+W9kMLyRYcned1x8xNa7VrdTVzzIOhjKIOV50d9rkAF6IRyZWy1/sVPWwds Hu9gfcdKhT60cyw8yomxjbx0dHQn3+YSMPnW1SijYnpL7TIe382xWIMwJVqn+xnVb6tw O0Jg== 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=V7oYmcP6SBUoeMA1SCFbG9LB8sh7NsVOLH35iprwP0Y=; b=S18rZG9bmQi9+AO4CkNj9xiYmxYOUrZJnW6Pwn5/zKJBjm1iqM7hlPWiYjUU3Rgy59 uqn6t3js5nh+8CzMky5FuWpQCw0NUzy8FAztYeXGQUSQadxb6hOuLyDiH7LfXRQHs0eA VUhSV+yiSzPKAYJocruQfRNHsjZNitdC7jqSfHs1VxWKz8VfhRi3s9NXCJRMaoA27jSC sfZHXGUhlCEncqGVzpPwTEHJDZRW3+5TIo+Bi/6xznauRqAkNjCrOjY+ZrUofObXZxxB b9/9xPPnvnOgghb7ZcnhiCXG223vA1UtV6Msr+KhGYn8luGv+M/f8m/u3sDqDiXyyIEL Jbvw== X-Gm-Message-State: APjAAAUFQSG3yBDz+DeHKEZvK4Q3rpfXfRfPeLErpx0sp/QmpDjDEfUH etKmvl/yybT5SMKj76EEKd8fnggNLkuxFyBIslXq9A== X-Received: by 2002:a6b:f30b:: with SMTP id m11mr4850113ioh.214.1567005634114; Wed, 28 Aug 2019 08:20:34 -0700 (PDT) MIME-Version: 1.0 References: <1566406146-7887-1-git-send-email-alex@zadara.com> <20190826133951.GC22759@fieldses.org> <20190827205158.GB13198@fieldses.org> In-Reply-To: <20190827205158.GB13198@fieldses.org> From: Alex Lyakas Date: Wed, 28 Aug 2019 18:20:22 +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, Thanks for the clarifications. On Tue, Aug 27, 2019 at 11:51 PM J. Bruce Fields wrote: > > On Tue, Aug 27, 2019 at 12:05:28PM +0300, Alex Lyakas wrote: > > Is the described issue familiar to you? > > Yep, got it, but I haven't seen anyone try to solve it using the fault > injection code, that's interesting! > > There's also fs/nfsd/unlock_filesystem. It only unlocks NLM (NFSv3) > locks. But it'd probably be reasonable to teach it to get NFSv4 state > too (locks, opens, delegations, and layouts). > > But my feeling's always been that the cleanest way to do it is to create > two containers with separate net namespaces and run nfsd in both of > them. You can start and stop the servers in the different containers > independently. I am looking at the code, and currently nfsd creates a single namespace subsystem in init_nfsd. All nfs4_clients run in this subsystem. So the proposal is to use register_pernet_subsys() for every filesystem that is exported? I presume that current nfsd code cannot do this, and some rework is required to move away from a single subsystem to per-export subsystem. Also, grepping through kernel code, I see that namespace subsystems are created by different modules as part of module initialization, rather than doing that dynamically. Furthermore, in our case the same nfsd machine S can export tens or even hundreds of local filesystems.Is this fine to have hundreds of subsystems? Otherwise, I understand that the current behavior is a "won't fix", and it is expected for the client machine to unmount the export before un-exporting the file system at nfsd machine. Is this correct? Thanks, Alex. > > > It is very easily reproducible. What is the way to solve it? To our > > understanding, if we un-export a FS from nfsd, we should be able to > > unmount it. > > Unexporting has never removed locks or opens or other state, for what > it's worth. > > --b.