diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-08-15 06:23:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-29 08:28:50 +0200 |
commit | f2951720629e7af751eccf4d8245d858cffc4d2c (patch) | |
tree | 7984b2f7dbb19773e794301b1fce99f01b998bb1 /fs/ceph | |
parent | 7bed2889cd184df203aab27ab7293b26b61816c6 (diff) | |
download | linux-stable-f2951720629e7af751eccf4d8245d858cffc4d2c.tar.gz linux-stable-f2951720629e7af751eccf4d8245d858cffc4d2c.tar.bz2 linux-stable-f2951720629e7af751eccf4d8245d858cffc4d2c.zip |
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/locks.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 9dae2ec7e1fa..6a8f4a99582e 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c @@ -111,8 +111,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode, req->r_wait_for_completion = ceph_lock_wait_for_completion; err = ceph_mdsc_do_request(mdsc, inode, req); - - if (operation == CEPH_MDS_OP_GETFILELOCK) { + if (!err && operation == CEPH_MDS_OP_GETFILELOCK) { fl->fl_pid = -le64_to_cpu(req->r_reply_info.filelock_reply->pid); if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) fl->fl_type = F_RDLCK; |