Commit 1ad3bb28 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov

ceph: assign the ci only when the inode isn't NULL

The ceph_find_inode() may will fail and return NULL.
Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 322794d3
...@@ -4166,7 +4166,6 @@ void ceph_handle_caps(struct ceph_mds_session *session, ...@@ -4166,7 +4166,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,
/* lookup ino */ /* lookup ino */
inode = ceph_find_inode(mdsc->fsc->sb, vino); inode = ceph_find_inode(mdsc->fsc->sb, vino);
ci = ceph_inode(inode);
dout(" op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), vino.ino, dout(" op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), vino.ino,
vino.snap, inode); vino.snap, inode);
...@@ -4192,6 +4191,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, ...@@ -4192,6 +4191,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
} }
goto flush_cap_releases; goto flush_cap_releases;
} }
ci = ceph_inode(inode);
/* these will work even if we don't have a cap yet */ /* these will work even if we don't have a cap yet */
switch (op) { switch (op) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment