Project

General

Profile

Actions

Bug #4184

closed

krbd: fix some sparse problems

Added by Alex Elder about 11 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The Linux kernel has a tool called "sparse" that scans
the source tree and reports various code problems that
the compiler doesn't otherwise tell you about.

A recent commit I made added a new one of these and
Fenguang Wu sent me an e-mail suggesting I fix it.
He sent me the larger sparse report.

I think these should all just be cleaned up. They're
all small, so I don't think there's any need for a new
issue for each, so I'll just fix as many as I can under
this one issue.

Note that the report below is for the upstream code;
some of these have I think been fixed in newer code
(in the testing branch).


Hi Alex,

FYI, there are new sparse warnings show up in

tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
head: cb50a575ec18762cfd26619f8d60b402ed1f81fe
commit: 8d23bf29095e5fab84535035e7a27c4920812c44 rbd: don't assign extent info in rbd_req_sync_op()
date: 4 weeks ago

drivers/block/rbd.c:1046:24: sparse: symbol 'rbd_osd_req_op_create' was not declared. Should it be static?

drivers/block/rbd.c:1370:42: sparse: Using plain integer as NULL pointer
drivers/block/rbd.c:1417:23: sparse: incorrect type in assignment (different base types)
drivers/block/rbd.c:1417:23: expected unsigned long long [unsigned] [usertype] ver
drivers/block/rbd.c:1417:23: got restricted __le64 [usertype] <noident>
drivers/block/rbd.c:1427:46: sparse: Using plain integer as NULL pointer
drivers/block/rbd.c:1480:23: sparse: incorrect type in assignment (different base types)
drivers/block/rbd.c:1480:23: expected unsigned long long [unsigned] [usertype] ver
drivers/block/rbd.c:1480:23: got restricted __le64 [assigned] [usertype] version
drivers/block/rbd.c:1481:26: sparse: incorrect type in assignment (different base types)
drivers/block/rbd.c:1481:26: expected unsigned long long [unsigned] [usertype] cookie
drivers/block/rbd.c:1481:26: got restricted __le64 [usertype] <noident>
drivers/block/rbd.c:2271:19: sparse: symbol 'rbd_dev_create' was not declared. Should it be static?
drivers/block/rbd.c:2815:17: sparse: incorrect type in assignment (different base types)
drivers/block/rbd.c:2815:17: expected restricted __le64 [usertype] snap_id
drivers/block/rbd.c:2815:17: got unsigned long long [unsigned] [long] [long long] <noident>
drivers/block/rbd.c:2816:46: sparse: incorrect type in argument 2 (different base types)
drivers/block/rbd.c:2816:46: expected unsigned long long [unsigned] [usertype] snap_id
drivers/block/rbd.c:2816:46: got restricted __le64 [usertype] snap_id
drivers/block/rbd.c:2819:50: sparse: incorrect type in argument 2 (different base types)
drivers/block/rbd.c:2819:50: expected unsigned long long [unsigned] [usertype] snap_id
drivers/block/rbd.c:2819:50: got restricted __le64 [usertype] snap_id
drivers/block/rbd.c:3835:12: sparse: symbol 'rbd_init' was not declared. Should it be static?
drivers/block/rbd.c:3846:13: sparse: symbol 'rbd_exit' was not declared. Should it be static?
drivers/block/rbd.c:1644:32: sparse: context imbalance in 'rbd_rq_fn' - unexpected unlock
Actions

Also available in: Atom PDF