OSDN Git Service

pNFS: Fix CB_LAYOUTRECALL stateid verification
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jul 2016 01:11:43 +0000 (21:11 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jul 2016 20:16:38 +0000 (16:16 -0400)
commit793b7fe55858dca1f5bd3e42185b541a9eddc144
tree3a6a4d1b8a38613f62074800e7afeb46895cc630
parentecebb80bf3ee8c5f3172f00bb17ba55f9e3ae24f
pNFS: Fix CB_LAYOUTRECALL stateid verification

We want to evaluate in this order:

If the client holds no layout for this inode, then return
NFS4ERR_NOMATCHING_LAYOUT; it probably forgot the layout.

If the client finds the inode among the list of layouts, but the corresponding
stateid has not yet been initialised, then return NFS4ERR_DELAY to ask the
server to retry once the outstanding LAYOUTGET is complete.

If the current layout stateid's "other" field does not match the recalled
stateid, return NFS4ERR_BAD_STATEID.

If already processing a layout recall with a newer stateid, return
NFS4ERR_OLD_STATEID. This can only happens for servers that are
non-compliant with the NFSv4.1 protocol.

If already processing a layout recall with an older stateid, return
NFS4ERR_DELAY to ask the server to retry once the outstanding
LAYOUTRETURN is complete. Again, this is technically incompliant with
the NFSv4.1 protocol.

If the current layout sequence id is newer than the recalled stateid's
sequence id, return NFS4ERR_OLD_STATEID. This too implies protocol
non-compliance.

If the current layout sequence id is older than the recalled stateid's
sequence id+1, return NFS4ERR_DELAY.

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