android_kernel_samsung_a7y1.../drivers/md/bcache
Coly Li 362150d0dc bcache: explicity type cast in bset_bkey_last()
[ Upstream commit 7c02b0055f774ed9afb6e1c7724f33bf148ffdc0 ]

In bset.h, macro bset_bkey_last() is defined as,
    bkey_idx((struct bkey *) (i)->d, (i)->keys)

Parameter i can be variable type of data structure, the macro always
works once the type of struct i has member 'd' and 'keys'.

bset_bkey_last() is also used in macro csum_set() to calculate the
checksum of a on-disk data structure. When csum_set() is used to
calculate checksum of on-disk bcache super block, the parameter 'i'
data type is struct cache_sb_disk. Inside struct cache_sb_disk (also in
struct cache_sb) the member keys is __u16 type. But bkey_idx() expects
unsigned int (a 32bit width), so there is problem when sending
parameters via stack to call bkey_idx().

Sparse tool from Intel 0day kbuild system reports this incompatible
problem. bkey_idx() is part of user space API, so the simplest fix is
to cast the (i)->keys to unsigned int type in macro bset_bkey_last().

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 13:57:25 +02:00
..
alloc.c bcache: avoid clang -Wunintialized warning 2020-04-06 18:18:21 +02:00
bcache.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bset.c bcache: fix stack corruption by PRECEDING_KEY() 2020-04-06 19:03:04 +02:00
bset.h bcache: explicity type cast in bset_bkey_last() 2020-04-07 13:57:25 +02:00
btree.c bcache: at least try to shrink 1 node in bch_mca_scan() 2020-04-07 13:23:22 +02:00
btree.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
closure.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
closure.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extents.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extents.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
io.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
journal.c bcache: fix failure in journal relplay 2020-04-06 18:18:17 +02:00
journal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
movinggc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
request.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
request.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stats.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stats.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c bcache: recal cached_dev_sectors on detach 2020-04-07 12:33:03 +02:00
sysfs.c bcache: fix input overflow to sequential_cutoff 2020-04-06 14:51:34 +02:00
sysfs.h bcache: improve sysfs_strtoul_clamp() 2020-04-06 14:51:38 +02:00
trace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
util.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
util.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
writeback.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
writeback.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30