diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2020-02-27 11:01:12 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2020-03-16 08:34:29 -0400 |
commit | d911c57a19551c6bef116a3b55c6b089901aacb0 (patch) | |
tree | 02c43b0ace26c5a5bd9e002a1b32d822d2012066 | |
parent | 194a0dc8e2c00c2b35da323639db8d96375490f9 (diff) | |
download | linux-d911c57a19551c6bef116a3b55c6b089901aacb0.tar.gz linux-d911c57a19551c6bef116a3b55c6b089901aacb0.tar.bz2 linux-d911c57a19551c6bef116a3b55c6b089901aacb0.zip |
NFSv4/pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid()
Make sure to test the stateid for validity so that we catch instances
where the server may have been reusing stateids in
nfs_layout_find_inode_by_stateid().
Fixes: 7b410d9ce460 ("pNFS: Delay getting the layout header in CB_LAYOUTRECALL handlers")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r-- | fs/nfs/callback_proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index b6ffac9963c8..eb9d035451a2 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -128,6 +128,8 @@ static struct inode *nfs_layout_find_inode_by_stateid(struct nfs_client *clp, list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { list_for_each_entry(lo, &server->layouts, plh_layouts) { + if (!pnfs_layout_is_valid(lo)) + continue; if (stateid != NULL && !nfs4_stateid_match_other(stateid, &lo->plh_stateid)) continue; |