]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4/pnfs: Ensure pnfs_parse_lgopen() won't try to parse uninitialised data
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 2 Feb 2017 01:42:44 +0000 (20:42 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 31 May 2018 19:03:11 +0000 (15:03 -0400)
commitc303a3f72ce87ce8abed639d0e84480e1bc576b8
tree8da9556b8140531e27f180cd726dba6e8e3e8cba
parentc5785d4b75087b3e07c221553683bd9d9f54e1b6
NFSv4/pnfs: Ensure pnfs_parse_lgopen() won't try to parse uninitialised data

We need to ensure that pnfs_parse_lgopen() doesn't try to parse a
struct nfs4_layoutget_res that was not filled by a successful call
to decode_layoutget(). This can happen if we performed a cached open,
or if either the OP_ACCESS or OP_GETATTR operations preceding the
OP_LAYOUTGET in the compound returned an error.

By initialising the 'status' field to NFS4ERR_DELAY, we ensure that
pnfs_parse_lgopen() won't try to interpret the structure.

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