Skip to content

Commit 1bb4253

Browse files
committed
Merge branch 'master' of https://github.com/bvanassche/fio
* 'master' of https://github.com/bvanassche/fio: zbd: Report the zone capacity zbd: Make an error message more detailed
2 parents 870ea00 + 04f9090 commit 1bb4253

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

zbd.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ static int zbd_report_zones(struct thread_data *td, struct fio_file *f,
213213
ret = blkzoned_report_zones(td, f, offset, zones, nr_zones);
214214
if (ret < 0) {
215215
td_verror(td, errno, "report zones failed");
216-
log_err("%s: report zones from sector %"PRIu64" failed (%d).\n",
217-
f->file_name, offset >> 9, errno);
216+
log_err("%s: report zones from sector %"PRIu64" failed (nr_zones=%d; errno=%d).\n",
217+
f->file_name, offset >> 9, nr_zones, errno);
218218
} else if (ret == 0) {
219219
td_verror(td, errno, "Empty zone report");
220220
log_err("%s: report zones from sector %"PRIu64" is empty.\n",
@@ -776,7 +776,8 @@ static int parse_zone_info(struct thread_data *td, struct fio_file *f)
776776
int nr_zones, nrz;
777777
struct zbd_zone *zones, *z;
778778
struct fio_zone_info *p;
779-
uint64_t zone_size, offset;
779+
uint64_t zone_size, offset, capacity;
780+
bool same_zone_cap = true;
780781
struct zoned_block_device_info *zbd_info = NULL;
781782
int i, j, ret = -ENOMEM;
782783

@@ -793,6 +794,7 @@ static int parse_zone_info(struct thread_data *td, struct fio_file *f)
793794
}
794795

795796
zone_size = zones[0].len;
797+
capacity = zones[0].capacity;
796798
nr_zones = (f->real_file_size + zone_size - 1) / zone_size;
797799

798800
if (td->o.zone_size == 0) {
@@ -821,6 +823,8 @@ static int parse_zone_info(struct thread_data *td, struct fio_file *f)
821823
PTHREAD_MUTEX_RECURSIVE);
822824
p->start = z->start;
823825
p->capacity = z->capacity;
826+
if (capacity != z->capacity)
827+
same_zone_cap = false;
824828

825829
switch (z->cond) {
826830
case ZBD_ZONE_COND_NOT_WP:
@@ -876,6 +880,11 @@ static int parse_zone_info(struct thread_data *td, struct fio_file *f)
876880
f->zbd_info->zone_size_log2 = is_power_of_2(zone_size) ?
877881
ilog2(zone_size) : 0;
878882
f->zbd_info->nr_zones = nr_zones;
883+
884+
if (same_zone_cap)
885+
dprint(FD_ZBD, "Zone capacity = %"PRIu64" KB\n",
886+
capacity / 1024);
887+
879888
zbd_info = NULL;
880889
ret = 0;
881890

0 commit comments

Comments
 (0)