]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFSv4/pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 27 Feb 2020 16:01:12 +0000 (11:01 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 16 Mar 2020 12:34:29 +0000 (08:34 -0400)
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: 64664195b0b0 ("pNFS: Delay getting the layout header in CB_LAYOUTRECALL handlers")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/callback_proc.c

index b6ffac9963c8badae547b17e83366e43d525886e..eb9d035451a2705a23d3a03a0a455afc9f7849bd 100644 (file)
@@ -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;