Fix spinup and spindown failure when skipping non-rotational devices

This commit is contained in:
Andrea Mazzoleni 2026-08-17 10:46:35 +02:00
parent 55f0644004
commit 175649e236
2 changed files with 12 additions and 4 deletions

View file

@ -1584,7 +1584,7 @@ static void* thread_spinup(void* arg)
/* skip not rotational devices */
if (devpower(devinfo->device, devinfo->name, devinfo->wfile) == 0)
return (void*)-1;
return 0;
start = os_tick_ms();
@ -1624,7 +1624,7 @@ static void* thread_spindown(void* arg)
/* skip not rotational devices */
if (devpower(devinfo->device, devinfo->name, devinfo->wfile) == 0)
return (void*)-1;
return 0;
start = os_tick_ms();
@ -1648,6 +1648,10 @@ static void* thread_spindownifup(void* arg)
uint64_t start;
int power;
/* skip not rotational devices */
if (devpower(devinfo->device, devinfo->name, devinfo->wfile) == 0)
return 0;
start = os_tick_ms();
if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &power) != 0) {

View file

@ -3475,7 +3475,7 @@ static void* thread_spinup(void* arg)
/* skip not rotational devices */
if (devpower(devinfo->device) == 0)
return (void*)-1;
return 0;
start = os_tick_ms();
@ -3520,7 +3520,7 @@ static void* thread_spindown(void* arg)
/* skip not rotational devices */
if (devpower(devinfo->device) == 0)
return (void*)-1;
return 0;
start = os_tick_ms();
@ -3549,6 +3549,10 @@ static void* thread_spindownifup(void* arg)
uint64_t start;
int power;
/* skip not rotational devices */
if (devpower(devinfo->device) == 0)
return 0;
start = os_tick_ms();
if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &power) != 0) {