Project

General

Profile

Bug #13055

zinject's range arg "-r" should accept hex values by default

Added by Sanjay Nadkarni 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

zinject [-q] <-t type> [-e errno] [-l level] [-r range]
[-a] [-m] [-u] [-f freq] <object>
allows one to inject failures only when specific range of blocks are accessed.
Range (start, end) assumes decimal values. However, the way one obtained these values is via zdb (zdb -ddddd <dataset> object) which prints out the logical block values for the object in hex (shown in bold).
e.g.
Indirect blocks:
0 L2 0:1008301000:3000 4000L/1000P F=720 B=123537/123537
0 L1 0:1004ca1000:6000 4000L/2000P F=128 B=123536/123536
0 L0 0:1000d4d000:2a000 20000L/20000P F=1 B=123536/123536
20000 L0 0:1000c7b000:2a000 20000L/20000P F=1 B=123536/123536
40000 L0 0:1000ca5000:2a000 20000L/20000P F=1 B=123536/123536
60000 L0 0:1000da1000:2a000 20000L/20000P F=1 B=123536/123536
80000 L0 0:1000ccf000:2a000 20000L/20000P F=1 B=123536/123536
a0000 L0 0:1000dcb000:2a000 20000L/20000P F=1 B=123536/123536
c0000 L0 0:1000cf9000:2a000 20000L/20000P F=1 B=123536/123536

It would be more useful for zinject to accept hex values.

The fix is change strtoull's base from 10 to 16 in initialize_range function: https://grok.elemental.org/source/xref/illumos-gate/usr/src/cmd/zinject/translate.c?r=d8ab6e12#178

No data to display

Also available in: Atom PDF