From 7d444c3445deeafba81826e33e8b34a05cfcd164 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Thu, 6 Jun 2024 22:40:52 +0900 Subject: [PATCH] ksmbd: work 11 Signed-off-by: Namjae Jeon --- vfs_cache.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/vfs_cache.c b/vfs_cache.c index 9fc6a928..4a44149c 100644 --- a/vfs_cache.c +++ b/vfs_cache.c @@ -317,10 +317,8 @@ static void ksmbd_remove_durable_fd(struct ksmbd_file *fp) write_lock(&global_ft.lock); __ksmbd_remove_durable_fd(fp); write_unlock(&global_ft.lock); - if (waitqueue_active(&dh_wq)) { - pr_err("%s:%d, wake up !!!!!!!!!!!!\n", __func__, __LINE__); + if (waitqueue_active(&dh_wq)) wake_up(&dh_wq); - } } static void __ksmbd_remove_fd(struct ksmbd_file_table *ft, struct ksmbd_file *fp) @@ -793,13 +791,10 @@ static bool ksmbd_durable_scavenger_alive(void) static void ksmbd_scavenger_dispose_dh(struct list_head *head) { - pr_err("%s:%d\n", __func__, __LINE__); while (!list_empty(head)) { struct ksmbd_file *fp; fp = list_first_entry(head, struct ksmbd_file, node); - pr_err("%s:%d, fp->durable_timeout : %u, fp->refcnt : %u, f_state : %d, fp->durable_scavenger_timeout : %u, jiffies_to_msecs : %u, fp->conn : %p\n", __func__, __LINE__, - fp->durable_timeout, atomic_read(&fp->refcount), fp->f_state, fp->durable_scavenger_timeout, jiffies_to_msecs(jiffies), fp->conn); list_del_init(&fp->node); __ksmbd_close_fd(NULL, fp); } @@ -816,7 +811,6 @@ static int ksmbd_durable_scavenger(void *dummy) __module_get(THIS_MODULE); - pr_err("%s : %d\n", __func__, __LINE__); set_freezable(); while (ksmbd_durable_scavenger_alive()) { if (try_to_freeze()) @@ -824,20 +818,15 @@ static int ksmbd_durable_scavenger(void *dummy) found_fp_timeout = false; - pr_err("1 min_timeout : %u, jiffies_to_msecs : %u, alive : %d\n", min_timeout, jiffies_to_msecs(jiffies), ksmbd_durable_scavenger_alive()); remaining_jiffies = wait_event_timeout(dh_wq, ksmbd_durable_scavenger_alive() == false, __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 = jiffies_to_msecs(remaining_jiffies); else min_timeout = DURABLE_HANDLE_MAX_TIMEOUT; write_lock(&global_ft.lock); idr_for_each_entry(global_ft.idr, fp, id) { - pr_err("%s:%d, fp->durable_timeout : %u, fp->refcnt : %u, f_state : %d, fp->durable_scavenger_timeout : %u, jiffies_to_msecs : %u, fp->conn : %p\n", __func__, __LINE__, - fp->durable_timeout, atomic_read(&fp->refcount), fp->f_state, fp->durable_scavenger_timeout, jiffies_to_msecs(jiffies), fp->conn); - if (!fp->durable_timeout) continue; @@ -848,7 +837,6 @@ static int ksmbd_durable_scavenger(void *dummy) found_fp_timeout = true; 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 { @@ -905,7 +893,6 @@ void ksmbd_stop_durable_scavenger(void) if (!(server_conf.flags & KSMBD_GLOBAL_FLAG_DURABLE_HANDLE)) return; - pr_err("%s:%d\n", __func__, __LINE__); mutex_lock(&durable_scavenger_lock); if (!durable_scavenger_running) { mutex_unlock(&durable_scavenger_lock); @@ -913,10 +900,8 @@ void ksmbd_stop_durable_scavenger(void) } durable_scavenger_running = false; - if (waitqueue_active(&dh_wq)) { - pr_err("%s:%d, wake up !!!!!!!!!!!!\n", __func__, __LINE__); + if (waitqueue_active(&dh_wq)) wake_up(&dh_wq); - } mutex_unlock(&durable_scavenger_lock); kthread_stop(server_conf.dh_task); } @@ -982,7 +967,6 @@ void ksmbd_free_global_file_table(void) idr_for_each_entry(global_ft.idr, fp, id) { ksmbd_remove_durable_fd(fp); - pr_err("fp durable timeout : %u\n", fp->durable_timeout); __ksmbd_close_fd(NULL, fp); }