diff --git a/vfs_cache.c b/vfs_cache.c index 37a3bb1d..9fc6a928 100644 --- a/vfs_cache.c +++ b/vfs_cache.c @@ -830,7 +830,7 @@ static int ksmbd_durable_scavenger(void *dummy) __msecs_to_jiffies(min_timeout)); pr_err("2 min_timeout : %u, jiffies_to_msecs : %u, alive : %d\n", min_timeout, jiffies_to_msecs(jiffies), ksmbd_durable_scavenger_alive()); if (remaining_jiffies) - min_timeout = fp->durable_timeout = jiffies_to_msecs(remaining_jiffies); + min_timeout = jiffies_to_msecs(remaining_jiffies); else min_timeout = DURABLE_HANDLE_MAX_TIMEOUT; write_lock(&global_ft.lock); @@ -846,15 +846,21 @@ static int ksmbd_durable_scavenger(void *dummy) continue; found_fp_timeout = true; - if (fp->durable_scavenger_timeout < + if (fp->durable_scavenger_timeout <= jiffies_to_msecs(jiffies)) { pr_err("closed!!!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); __ksmbd_remove_durable_fd(fp); list_add(&fp->node, &scavenger_list); - } + } else { + unsigned long durable_timeout; + + durable_timeout = + fp->durable_scavenger_timeout - + jiffies_to_msecs(jiffies); - if (min_timeout > fp->durable_timeout) - min_timeout = fp->durable_timeout; + if (min_timeout > durable_timeout) + min_timeout = durable_timeout; + } } write_unlock(&global_ft.lock);