Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5973522pxb; Thu, 27 Jan 2022 03:51:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhzlBI5xL6NjDJ39lt7/Ih1J8XiKZP8RROpSPMpJD4Q63+kwzq8FKdcBAvl3IKTKjZ9LDI X-Received: by 2002:a05:6402:5110:: with SMTP id m16mr3309176edd.325.1643284275143; Thu, 27 Jan 2022 03:51:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643284275; cv=none; d=google.com; s=arc-20160816; b=IBbUTd8xH/rVt+JFiHqfMTtkvv4fmq6gMBgRECLNruQ5D+tYYqCRa0Cljjhp1ppXJY lCJI1OyTDavIP6ByslNTf3f6NUuluJQ/+d7g8AZHYQv5L+l/TAPm14w/HLqbmhqHpMB4 eYjLg9EepSDtPdIwi18hIxPUO3vaxQKeTrm0BG1ld2Lo3Xh6hl/KTFCUHqMCe+u9mSXA 99w/e8sasKClJlfaHA+L+DfpP1vDMjdVXmBankaA5y0jKkY8XxJ7etZqkiJTp6Pzuc7V Dr6LZ0LSGzWyOydGr2XfbGxBZgI9uGOuaWnu+8/jcOek1zq8vnZLDqAt8UzX4uNFe6xj AyYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature :dkim-signature; bh=xszqTo1DyKYonBKGa/iL/nAoqWmCcf8Bz0XHj9p3SN8=; b=nU63cXw4j+f4o5Ri0QAvy0ksT2Z2RzMX6+QVeOh2tM3Wt+4c9FeKgfVsDrWEhggAEG MiPH++y7upLYsXBg0RSbySMrgEhJf7u5go0g66trF09R6JJ462FqzLyuIPoksMjLU8wC /L3s/i+YIxf0gXS4VEh+JpcZACzVwmfLxZ2F4UY65mUxmjM++pKD6Iq28Tan7Bg2IoJF j4h9NXJKmvOk0HRknf+XULEAJTh0LdGljr+SfBPNAfbGhN/dvkxVymEo8PqQPFf+8SAb YQmCXP7U8hUHScjITwtCp476y9FaKwlFR02cdWqHlC9//we5YD6tO/kH4zGy+IPV/tTr +xGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=f2L2F3Vm; dkim=neutral (no key) header.i=@suse.de header.b=qb+RzG9E; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si1515532edc.398.2022.01.27.03.50.47; Thu, 27 Jan 2022 03:51:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=f2L2F3Vm; dkim=neutral (no key) header.i=@suse.de header.b=qb+RzG9E; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbiA0E7k (ORCPT + 99 others); Wed, 26 Jan 2022 23:59:40 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:44012 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236094AbiA0E7k (ORCPT ); Wed, 26 Jan 2022 23:59:40 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 834E91F3AF; Thu, 27 Jan 2022 04:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643259578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xszqTo1DyKYonBKGa/iL/nAoqWmCcf8Bz0XHj9p3SN8=; b=f2L2F3Vmd7MSETV888ZRO4OhYlmHwaSpuxRHRmdZHuPbSNRpreTCAMn7YLuOHawxaGMBnh +nq43BHfjIs9wzdE0YUP5pV1mJgskDhmAZQS+P/NM3laTW6LRFLy2yDC5gaXuQkLg3ozTt KqJAB+tTpqv/9Ad2iWHICa3ScZBouGg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643259578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xszqTo1DyKYonBKGa/iL/nAoqWmCcf8Bz0XHj9p3SN8=; b=qb+RzG9EuwvgV9CfKO72eo2vDRVAAdESXluLKbtH60kxewpmwOV+Khy6MK3fq5ucC7sJdK V/vZdkihkM5AG+Aw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A595713BCF; Thu, 27 Jan 2022 04:59:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id leX8GLkm8mErVgAAMHmgww (envelope-from ); Thu, 27 Jan 2022 04:59:37 +0000 Subject: [RFC PATCH 0/4] nfsd: allow NFSv4 state to be revoked. From: NeilBrown To: Chuck Lever Cc: linux-nfs@vger.kernel.org Date: Thu, 27 Jan 2022 15:58:10 +1100 Message-ID: <164325908579.23133.4781039121536248752.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If a filesystem is exported to a client with NFSv4 and that client holds a file open, the filesystem cannot be unmounted without either stopping the NFS server completely, or blocking all access from that client (unexporting all filesystems) and waiting for the lease timeout. For NFSv3 - and particularly NLM - it is possible to revoke all state by writing the path to the filesystem into /proc/fs/nfsd/unlock_filesystem. This series extends this functionality to NFSv4. With this, to unmount an exported filesystem is it sufficient to disable export of that filesystem, and then write the path to unlock_filesystem. I've cursed mainly on NFSv4.1 and later for this. I haven't tested yet with NFSv4.0 which has different mechanisms for state management. If this series is seen as a general acceptable approach, I'll look into the NFSv4.0 aspects properly and make sure it works there. Thanks, NeilBrown --- NeilBrown (4): nfsd: prepare for supporting admin-revocation of state nfsd: allow open state ids to be revoked and then freed nfsd: allow lock state ids to be revoked and then freed nfsd: allow delegation state ids to be revoked and then freed fs/nfsd/nfs4state.c | 105 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 9 deletions(-) -- Signature