mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 03:16:59 -05:00
Detect degraded filesystems in device commands and exit with EXIT_DEGRADED
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
2a4335ef7d
commit
3ba6d0243d
47 changed files with 184 additions and 4 deletions
|
|
@ -1198,6 +1198,8 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
if (state->opt.gui)
|
||||
log_tag("unixtime:%" PRIi64 "\n", (int64_t)now);
|
||||
|
||||
int degraded = 0;
|
||||
|
||||
if (state->opt.fake_device) {
|
||||
ret = devtest(&high, &low, operation);
|
||||
} else {
|
||||
|
|
@ -1206,6 +1208,10 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
devsync(&high);
|
||||
|
||||
ret = devquery(&high, &low);
|
||||
if (ret > 0) {
|
||||
degraded = 1;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* if the list is empty, it's not supported in this platform */
|
||||
|
|
@ -1251,6 +1257,9 @@ bail:
|
|||
tommy_list_foreach(&high, free);
|
||||
tommy_list_foreach(&low, free);
|
||||
|
||||
if (ret == 0 && degraded)
|
||||
ret = 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue