]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/zns: crimson osd crashes when device size is huge
authorAravind Ramesh <Aravind.Ramesh@wdc.com>
Thu, 25 Aug 2022 03:44:52 +0000 (09:14 +0530)
committerAravind <aravind.ramesh@wdc.com>
Fri, 2 Sep 2022 05:07:05 +0000 (10:37 +0530)
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 <aravind.ramesh@wdc.com>
src/crimson/os/seastore/segment_manager/zns.cc

index cfca8da737d03b9b5f6d75713cd95ae56fda03b0..6f3f22465bb13cc19824e814c3f06036c03a3515 100644 (file)
@@ -129,8 +129,8 @@ static seastar::future<size_t> 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{},