mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-03-10 00:00:04 +03:00
bcacheadm: fix status command
Don't say that the device is missing unless it is still showing "active" state. Change-Id: I708d7719c6f6804cd06e75cbadf7bea36ac4b62d Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
parent
47013b3d06
commit
aa3e2d589d
@ -672,10 +672,15 @@ int bcache_status(NihCommand *command, char *const *args)
|
||||
|
||||
for (j = 0; j < dev_count; j++) {
|
||||
if (!strcmp(uuid_str, dev_uuids[j])) {
|
||||
snprintf(dev_state, MAX_PATH, "%s", cache_state[CACHE_STATE(m)]);
|
||||
snprintf(dev_state, MAX_PATH, "%s",
|
||||
cache_state[CACHE_STATE(m)]);
|
||||
break;
|
||||
} else if (j == dev_count - 1) {
|
||||
snprintf(dev_state, MAX_PATH, "%s", "missing");
|
||||
if (!strcmp(cache_state[CACHE_STATE(m)], "active"))
|
||||
snprintf(dev_state, MAX_PATH, "%s", "missing");
|
||||
else
|
||||
snprintf(dev_state, MAX_PATH, "%s",
|
||||
cache_state[CACHE_STATE(m)]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user