mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Skip inaccessible disks and parity levels in device operations
This commit is contained in:
parent
316a9cf135
commit
720073d80d
1 changed files with 15 additions and 2 deletions
|
|
@ -1129,6 +1129,10 @@ int state_device_force(struct snapraid_state* state, int operation, tommy_list*
|
||||||
if (filterlist_disk != 0 && filter_path(filterlist_disk, 0, disk->name, 0) != 0)
|
if (filterlist_disk != 0 && filter_path(filterlist_disk, 0, disk->name, 0) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* skips inaccessible disks from all device operations */
|
||||||
|
if (disk->skip_access)
|
||||||
|
continue;
|
||||||
|
|
||||||
entry = calloc_nofail(1, sizeof(devinfo_t));
|
entry = calloc_nofail(1, sizeof(devinfo_t));
|
||||||
|
|
||||||
entry->device = disk->mount_device;
|
entry->device = disk->mount_device;
|
||||||
|
|
@ -1151,6 +1155,10 @@ int state_device_force(struct snapraid_state* state, int operation, tommy_list*
|
||||||
if (filterlist_disk != 0 && filter_path(filterlist_disk, 0, lev_config_name(j), 0) != 0)
|
if (filterlist_disk != 0 && filter_path(filterlist_disk, 0, lev_config_name(j), 0) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* skips inaccessible parities from all device operations */
|
||||||
|
if (state->parity[j].skip_access)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (s = 0; s < state->parity[j].split_mac; ++s) {
|
for (s = 0; s < state->parity[j].split_mac; ++s) {
|
||||||
entry = calloc_nofail(1, sizeof(devinfo_t));
|
entry = calloc_nofail(1, sizeof(devinfo_t));
|
||||||
|
|
||||||
|
|
@ -1229,9 +1237,14 @@ int state_device_force(struct snapraid_state* state, int operation, tommy_list*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the list is empty, it's not supported in this platform */
|
/* distinguish skipped devices from unsupported device queries */
|
||||||
if (ret == 0 && tommy_list_empty(&low))
|
if (ret == 0 && tommy_list_empty(&low)) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
if (tommy_list_empty(&high)) {
|
||||||
|
log_error(ESOFT, "No accessible devices selected for this operation.\n");
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
const char* ope = 0;
|
const char* ope = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue