pNFS: Don't forget the layout stateid if there are outstanding LAYOUTGETs
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 4 Sep 2016 16:46:35 +0000 (12:46 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 4 Sep 2016 16:59:00 +0000 (12:59 -0400)
commit334a8f37115bf35e38617315a360a91ac4f2b2c6
treeb07b98d2a766ca6faa34d80e0e2ba778a74bcc77
parent52ec7be2e27392201adf77892ba883f68df88c99
pNFS: Don't forget the layout stateid if there are outstanding LAYOUTGETs

If there are outstanding LAYOUTGET rpc calls, then we want to ensure that
we keep the layout stateid around so we that don't inadvertently pick up
an old/misordered sequence id.
The race is as follows:

Client Server
====== ======
LAYOUTGET(seqid)
LAYOUTGET(seqid)
return LAYOUTGET(seqid+1)
return LAYOUTGET(seqid+2)
process LAYOUTGET(seqid+2)
forget layout
process LAYOUTGET(seqid+1)

If it forgets the layout stateid before processing seqid+1, then
the client will not check the layout->plh_barrier, and so will set
the stateid with seqid+1.

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