summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbcachefs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbcachefs.c b/libbcachefs.c
index ea52ce48..f84a34ca 100644
--- a/libbcachefs.c
+++ b/libbcachefs.c
@@ -927,7 +927,9 @@ int bchu_data(struct bchfs_handle fs, struct bch_ioctl_data cmd)
printf("\33[2K\r");
printf("%llu%% complete: current position %s",
- e.p.sectors_done * 100 / e.p.sectors_total,
+ e.p.sectors_total
+ ? e.p.sectors_done * 100 / e.p.sectors_total
+ : 0,
bch2_data_types[e.p.data_type]);
switch (e.p.data_type) {