Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 1/7] pNFS: Mark layout for return if return-on-close was not sent
@ 2021-01-07  5:31 trondmy
  2021-01-07  5:31 ` [PATCH v2 2/7] pNFS: We want return-on-close to complete when evicting the inode trondmy
  0 siblings, 1 reply; 7+ messages in thread
From: trondmy @ 2021-01-07  5:31 UTC (permalink / raw)
  To: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

If the layout return-on-close failed because the layoutreturn was never
sent, then we should mark the layout for return again.

Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/pnfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 07f59dc8cb2e..e8d08ec6fa86 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1560,12 +1560,19 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
 		int ret)
 {
 	struct pnfs_layout_hdr *lo = args->layout;
+	struct inode *inode = args->inode;
 	const nfs4_stateid *arg_stateid = NULL;
 	const nfs4_stateid *res_stateid = NULL;
 	struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
 
 	switch (ret) {
 	case -NFS4ERR_NOMATCHING_LAYOUT:
+		spin_lock(&inode->i_lock);
+		if (pnfs_layout_is_valid(lo) &&
+		    nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid))
+			pnfs_set_plh_return_info(lo, args->range.iomode, 0);
+		pnfs_clear_layoutreturn_waitbit(lo);
+		spin_unlock(&inode->i_lock);
 		break;
 	case 0:
 		if (res->lrs_present)
-- 
2.29.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07  5:31 [PATCH v2 1/7] pNFS: Mark layout for return if return-on-close was not sent trondmy
2021-01-07  5:31 ` [PATCH v2 2/7] pNFS: We want return-on-close to complete when evicting the inode trondmy
2021-01-07  5:31   ` [PATCH v2 3/7] pNFS: Clean up pnfs_layoutreturn_free_lsegs() trondmy
2021-01-07  5:31     ` [PATCH v2 4/7] pNFS: Stricter ordering of layoutget and layoutreturn trondmy
2021-01-07  5:31       ` [PATCH v2 5/7] NFS/pNFS: Don't call pnfs_free_bucket_lseg() before removing the request trondmy
2021-01-07  5:31         ` [PATCH v2 6/7] NFS/pNFS: Don't leak DS commits in pnfs_generic_retry_commit() trondmy
2021-01-07  5:31           ` [PATCH v2 7/7] NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter trondmy

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git