Skip to content

Commit 08bd8db

Browse files
author
Trond Myklebust
committed
pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process()
If the server returns a new stateid that does not match the one in our cache, then try to return the one we hold instead of just invalidating it on the client side. This ensures that both client and server will agree that the stateid is invalid. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 814b849 commit 08bd8db

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

fs/nfs/pnfs.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
23982398
* We got an entirely new state ID. Mark all segments for the
23992399
* inode invalid, and retry the layoutget
24002400
*/
2401-
pnfs_mark_layout_stateid_invalid(lo, &free_me);
2401+
struct pnfs_layout_range range = {
2402+
.iomode = IOMODE_ANY,
2403+
.length = NFS4_MAX_UINT64,
2404+
};
2405+
pnfs_set_plh_return_info(lo, IOMODE_ANY, 0);
2406+
pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs,
2407+
&range, 0);
24022408
goto out_forget;
24032409
}
24042410

@@ -2417,7 +2423,6 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
24172423
spin_unlock(&ino->i_lock);
24182424
lseg->pls_layout = lo;
24192425
NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg);
2420-
pnfs_free_lseg_list(&free_me);
24212426
return ERR_PTR(-EAGAIN);
24222427
}
24232428

0 commit comments

Comments
 (0)