From: Aravind Ramesh Date: Thu, 25 Aug 2022 03:44:52 +0000 (+0530) Subject: crimson/zns: crimson osd crashes when device size is huge X-Git-Tag: v18.0.0~94^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bd0676ba7a90010816997223fc8aa51c8820eea;p=ceph.git crimson/zns: crimson osd crashes when device size is huge In reset_device(), if the total number of 512B sectors on the device is more than INT_MAX then there was a overflow happening, rendering the nr_sectors as 0, which was causing the failure of the ioctl and subsequent crash, fix the overflow. Signed-off-by: Aravind Ramesh --- diff --git a/src/crimson/os/seastore/segment_manager/zns.cc b/src/crimson/os/seastore/segment_manager/zns.cc index cfca8da737d0..6f3f22465bb1 100644 --- a/src/crimson/os/seastore/segment_manager/zns.cc +++ b/src/crimson/os/seastore/segment_manager/zns.cc @@ -129,8 +129,8 @@ static seastar::future get_blk_dev_size( // zone_size should be in 512B sectors static seastar::future<> reset_device( seastar::file &device, - uint32_t zone_size_sects, - uint32_t nr_zones) + uint64_t zone_size_sects, + uint64_t nr_zones) { return seastar::do_with( blk_zone_range{},