pNFS: Clear the layout metadata if the server changed the layout stateid
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jul 2016 19:04:07 +0000 (15:04 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jul 2016 20:16:41 +0000 (16:16 -0400)
If the server changed the layout stateid's "other" field, then
we should treat the old layout as being completely gone. In that
case, we want to clear the metadata such as scheduled layoutreturns.

Do this by calling pnfs_mark_layout_stateid_invalid().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c

index 1374fcd404843b985fe4bd97da152a933a1a425a..e16997da157fe633d0ca5efb7e4bc2caecbf0f67 100644 (file)
@@ -1785,7 +1785,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
                 * inode invalid, and don't bother validating the stateid
                 * sequence number.
                 */
-               pnfs_mark_matching_lsegs_invalid(lo, &free_me, NULL, 0);
+               pnfs_mark_layout_stateid_invalid(lo, &free_me);
 
                nfs4_stateid_copy(&lo->plh_stateid, &res->stateid);
                lo->plh_barrier = be32_to_cpu(res->stateid.seqid);