diff mbox series

[3/3] NFSv4.1: Simplify layout return in pnfs_layout_process()

Message ID 20210416125121.5753-3-trondmy@kernel.org (mailing list archive)
State New
Headers show
Series [1/3] NFSv4.x: Don't return NFS4ERR_NOMATCHING_LAYOUT if we're unmounting | expand

Commit Message

trondmy@kernel.org April 16, 2021, 12:51 p.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

If the server hands us a layout that does not match the one we currently
hold, then have pnfs_mark_matching_lsegs_return() just ditch the old
layout if NFS_LSEG_LAYOUTRETURN is not set.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/pnfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 33574f47601f..fa22b4be9212 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2410,9 +2410,7 @@  pnfs_layout_process(struct nfs4_layoutget *lgp)
 			.iomode = IOMODE_ANY,
 			.length = NFS4_MAX_UINT64,
 		};
-		pnfs_set_plh_return_info(lo, IOMODE_ANY, 0);
-		pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs,
-						&range, 0);
+		pnfs_mark_matching_lsegs_return(lo, &free_me, &range, 0);
 		goto out_forget;
 	} else {
 		/* We have a completely new layout */