Skip to content

Commit

Permalink
ceph: assign the ci only when the inode isn't NULL
Browse files Browse the repository at this point in the history
The ceph_find_inode() may will fail and return NULL.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Xiubo Li authored and Ilya Dryomov committed Mar 21, 2022
1 parent 322794d commit 1ad3bb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -4166,7 +4166,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,

/* lookup ino */
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,
vino.snap, inode);

Expand All @@ -4192,6 +4191,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
}
goto flush_cap_releases;
}
ci = ceph_inode(inode);

/* these will work even if we don't have a cap yet */
switch (op) {
Expand Down

0 comments on commit 1ad3bb2

Please sign in to comment.