diff options
author | Luis Henriques <lhenriques@suse.com> | 2019-07-23 18:50:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-11 19:36:31 +0300 |
commit | 9250e1786418432a88d37e4df4b90700efa3fe6f (patch) | |
tree | 84e91be9943ae5a7d0b5859e34b1b1746add93c7 /lib/test_static_key_base.c | |
parent | d78709c11d76dc7e1fbad99f939bed41672e5637 (diff) | |
download | linux-9250e1786418432a88d37e4df4b90700efa3fe6f.tar.xz |
ceph: fix directories inode i_blkbits initialization
[ Upstream commit 750670341a24cb714e624e0fd7da30900ad93752 ]
When filling an inode with info from the MDS, i_blkbits is being
initialized using fl_stripe_unit, which contains the stripe unit in
bytes. Unfortunately, this doesn't make sense for directories as they
have fl_stripe_unit set to '0'. This means that i_blkbits will be set
to 0xff, causing an UBSAN undefined behaviour in i_blocksize():
UBSAN: Undefined behaviour in ./include/linux/fs.h:731:12
shift exponent 255 is too large for 32-bit type 'int'
Fix this by initializing i_blkbits to CEPH_BLOCK_SHIFT if fl_stripe_unit
is zero.
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/test_static_key_base.c')
0 files changed, 0 insertions, 0 deletions