Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168117905
D38130.id115342.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38130.id115342.diff
View Options
diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c
--- a/usr.bin/ctlstat/ctlstat.c
+++ b/usr.bin/ctlstat/ctlstat.c
@@ -402,12 +402,16 @@
continue; \
for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; iotype++) { \
int lun = stats[i].item; \
+ const char *target; \
if (lun >= targdata.ntargets) \
- errx(1, "LUN %u out of range", lun); \
+ /* LUN is not associated with any target */ \
+ target = ""; \
+ else \
+ target = targdata.targets[lun]; \
printf("iscsi_target_" #field "{" \
"lun=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \
"\n", \
- lun, targdata.targets[lun], iotypes[iotype], \
+ lun, target, iotypes[iotype], \
stats[i].field[iotype]); \
} \
} \
@@ -421,14 +425,18 @@
uint64_t us; \
struct timespec ts; \
int lun = stats[i].item; \
+ const char *target; \
if (lun >= targdata.ntargets) \
- errx(1, "LUN %u out of range", lun); \
+ /* LUN is not associated with any target */ \
+ target = ""; \
+ else \
+ target = targdata.targets[lun]; \
bintime2timespec(&stats[i].field[iotype], &ts); \
us = ts.tv_sec * 1000000 + ts.tv_nsec / 1000; \
printf("iscsi_target_" #field "{" \
"lun=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \
"\n", \
- lun, targdata.targets[lun], iotypes[iotype], us); \
+ lun, target, iotypes[iotype], us); \
} \
} \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 11:29 AM (5 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37379536
Default Alt Text
D38130.id115342.diff (1 KB)
Attached To
Mode
D38130: ctlstat: fix -P with disassociated LUNs.
Attached
Detach File
Event Timeline
Log In to Comment