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:28:50 +0000 (08:28 +0200)
commitf2951720629e7af751eccf4d8245d858cffc4d2c
tree7984b2f7dbb19773e794301b1fce99f01b998bb1
parent7bed2889cd184df203aab27ab7293b26b61816c6
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