pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 17 Jul 2019 17:57:44 +0000 (13:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:37 +0000 (07:28 +0200)
commita471b4253744e98afc498b2fa6dc674c7beb0555
tree0627b3a0e309e54b2caa71c375891660f940538b
parenteada919dddca354bb9a087b867fc9bc468671982
pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error

commit 8e04fdfadda75a849c649f7e50fe7d97772e1fcb upstream.

mirror->mirror_ds can be NULL if uninitialised, but can contain
a PTR_ERR() if call to GETDEVICEINFO failed.

Fixes: 65990d1afbd2 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org # 4.10+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/flexfilelayout/flexfilelayoutdev.c