From: Trond Myklebust Date: Sun, 18 Apr 2021 19:00:45 +0000 (-0400) Subject: NFSv4: Don't discard segments marked for return in _pnfs_return_layout() X-Git-Tag: v4.9.269~188 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80e34f4957ec3010c85f9bb0b568a8d46acdf535;p=thirdparty%2Fkernel%2Fstable.git NFSv4: Don't discard segments marked for return in _pnfs_return_layout() commit de144ff4234f935bd2150108019b5d87a90a8a96 upstream. If the pNFS layout segment is marked with the NFS_LSEG_LAYOUTRETURN flag, then the assumption is that it has some reporting requirement to perform through a layoutreturn (e.g. flexfiles layout stats or error information). Fixes: 6d597e175012 ("pnfs: only tear down lsegs that precede seqid in LAYOUTRETURN args") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index c3abf92adfb7d..d347d95a1bac1 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1088,7 +1088,7 @@ _pnfs_return_layout(struct inode *ino) pnfs_get_layout_hdr(lo); empty = list_empty(&lo->plh_segs); pnfs_clear_layoutcommit(ino, &tmp_list); - pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL, 0); + pnfs_mark_matching_lsegs_return(lo, &tmp_list, NULL, 0); if (NFS_SERVER(ino)->pnfs_curr_ld->return_range) { struct pnfs_layout_range range = {