ceph: don't try fill file_lock on unsuccessful GETFILELOCK reply
authorJeff Layton <jlayton@kernel.org>
Thu, 15 Aug 2019 10:23:38 +0000 (06:23 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:26:42 +0000 (08:26 +0200)
commite6a1bf13502beaa3a7d912c040f87b82272ea1d8
tree81df7b33140498f6ebaaea0f82c1606be7eb22b5
parentd2cbe6a3e39323bc30145ac5dfc5abb107315c15
ceph: don't try fill file_lock on unsuccessful GETFILELOCK reply

commit 28a282616f56990547b9dcd5c6fbd2001344664c upstream.

When ceph_mdsc_do_request returns an error, we can't assume that the
filelock_reply pointer will be set. Only try to fetch fields out of
the r_reply_info when it returns success.

Cc: stable@vger.kernel.org
Reported-by: Hector Martin <hector@marcansoft.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/locks.c