Skip to content

Commit 9aaa7eb

Browse files
lxbszidryomov
authored andcommitted
ceph: silence smatch warning in reconnect_caps_cb()
Smatch static checker warning: fs/ceph/mds_client.c:3968 reconnect_caps_cb() warn: missing error code here? '__get_cap_for_mds()' failed. 'err' = '0' [ idryomov: Dan says that Smatch considers it intentional only if the "ret = 0;" assignment is within 4 or 5 lines of the goto. ] Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent f1fcbaa commit 9aaa7eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/ceph/mds_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
39423942
struct dentry *dentry;
39433943
struct ceph_cap *cap;
39443944
char *path;
3945-
int pathlen = 0, err = 0;
3945+
int pathlen = 0, err;
39463946
u64 pathbase;
39473947
u64 snap_follows;
39483948

@@ -3965,6 +3965,7 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
39653965
cap = __get_cap_for_mds(ci, mds);
39663966
if (!cap) {
39673967
spin_unlock(&ci->i_ceph_lock);
3968+
err = 0;
39683969
goto out_err;
39693970
}
39703971
dout(" adding %p ino %llx.%llx cap %p %lld %s\n",

0 commit comments

Comments
 (0)