Skip to content

Commit 1ad3bb2

Browse files
lxbszidryomov
authored andcommitted
ceph: assign the ci only when the inode isn't NULL
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>
1 parent 322794d commit 1ad3bb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ceph/caps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4166,7 +4166,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,
41664166

41674167
/* lookup ino */
41684168
inode = ceph_find_inode(mdsc->fsc->sb, vino);
4169-
ci = ceph_inode(inode);
41704169
dout(" op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), vino.ino,
41714170
vino.snap, inode);
41724171

@@ -4192,6 +4191,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
41924191
}
41934192
goto flush_cap_releases;
41944193
}
4194+
ci = ceph_inode(inode);
41954195

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

0 commit comments

Comments
 (0)