mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-03 00:00:07 +03:00
bcacheadm: Fix bcacheadm status segfault if no devs given
Fixes DAT-1655 Change-Id: I79cfc78fb8513f3e751332d65310d65020c15e3e Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
parent
be4e8676b6
commit
f8d3f7da8f
@ -590,10 +590,12 @@ int bcache_status(NihCommand *command, char *const *args)
|
|||||||
free(sb);
|
free(sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!seq_sb)
|
if(!seq_sb) {
|
||||||
printf("Unable to find a superblock\n");
|
printf("Unable to find a superblock\n");
|
||||||
else
|
return -1;
|
||||||
|
} else {
|
||||||
printf("%-50s%-15s%-4s\n", "uuid", "state", "tier");
|
printf("%-50s%-15s%-4s\n", "uuid", "state", "tier");
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < seq_sb->nr_in_set; i++) {
|
for (i = 0; i < seq_sb->nr_in_set; i++) {
|
||||||
char uuid_str[40];
|
char uuid_str[40];
|
||||||
|
Loading…
Reference in New Issue
Block a user