Skip to contentSkip to conversation

smb/server: replace deprecated system workqueues

PATCH Applied ZhangGuoDong 2 participants 2 messages Oct 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb/server: replace deprecated system workqueues

From: ZhangGuoDong <[email protected]>

Queueing the lease break timer on system_wq triggers the following warning:

workqueue: work func lease_break_timer [ksmbd] enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.

The oplock break timer and TCP transmit work also use deprecated system queues.

---
 fs/smb/server/oplock.c        | 4 ++--
 fs/smb/server/transport_tcp.c | 6 +++---
 fs/smb/server/vfs_cache.c     | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
fs/smb/server/oplock.c +2 -2
index e76dfc904fb9..d479508c06c5 100644
@@ -178,7 +178,7 @@ static void lease_break_timer(struct work_struct *work)
 	lease_break_timer_pending = pending;
 	if (pending) {
 		lease_break_timer_next = next;
-		mod_delayed_work(system_wq, &lease_break_timer_work,
+		mod_delayed_work(system_percpu_wq, &lease_break_timer_work,
 				 time_after_eq(jiffies, next) ? 0 : next - jiffies);
 	}
 	mutex_unlock(&lease_break_timer_lock);
@@ -191,7 +191,7 @@ static void schedule_lease_break_timer(unsigned long timeout)
 	    time_before(timeout, lease_break_timer_next)) {
 		lease_break_timer_pending = true;
 		lease_break_timer_next = timeout;
-		mod_delayed_work(system_wq, &lease_break_timer_work,
+		mod_delayed_work(system_percpu_wq, &lease_break_timer_work,
 				 time_after_eq(jiffies, timeout) ? 0 : timeout - jiffies);
 	}
 	mutex_unlock(&lease_break_timer_lock);
fs/smb/server/transport_tcp.c +3 -3
index 9c6ca878d30f..937d321fa364 100644
@@ -573,7 +573,7 @@ static void ksmbd_tcp_tx_work(struct work_struct *work)
 	if (READ_ONCE(t->tx_stopped))
 		ksmbd_tcp_purge_tx(t);
 	else if (!list_empty(&t->tx_queue))
-		queue_delayed_work(system_unbound_wq, &t->tx_work, delay);
+		queue_delayed_work(system_dfl_wq, &t->tx_work, delay);
 	mutex_unlock(&t->tx_lock);
 	wake_up_all(&t->transport.conn->req_running_q);
 
@@ -590,7 +590,7 @@ static void ksmbd_tcp_write_space(struct sock *sk)
 	if (t) {
 		t->write_space(sk);
 		if (!READ_ONCE(t->tx_stopped) && sk_stream_is_writeable(sk))
-			mod_delayed_work(system_unbound_wq, &t->tx_work, 0);
+			mod_delayed_work(system_dfl_wq, &t->tx_work, 0);
 	}
 	read_unlock_bh(&sk->sk_callback_lock);
 }
@@ -687,7 +687,7 @@ static int ksmbd_tcp_writev(struct ksmbd_transport *t,
 	msg->deadline = deadline;
 	list_add_tail(&msg->list, &tt->tx_queue);
 	WRITE_ONCE(tt->tx_queued, tt->tx_queued + msg->len);
-	queue_delayed_work(system_unbound_wq, &tt->tx_work, 0);
+	queue_delayed_work(system_dfl_wq, &tt->tx_work, 0);
 
 accepted:
 	tt->tx_end += tx->size;
fs/smb/server/vfs_cache.c +2 -2
index bfa28ef197f6..452ce05d1494 100644
@@ -87,7 +87,7 @@ static void ksmbd_oplock_break_timer(struct work_struct *work)
 	oplock_break_timer_pending = pending;
 	if (pending) {
 		oplock_break_timer_next = next;
-		mod_delayed_work(system_wq, &oplock_break_timer_work,
+		mod_delayed_work(system_percpu_wq, &oplock_break_timer_work,
 				 time_after_eq(jiffies, next) ? 0 : next - jiffies);
 	}
 	mutex_unlock(&oplock_break_timer_lock);
@@ -100,7 +100,7 @@ void ksmbd_schedule_oplock_break_timer(unsigned long timeout)
 	    time_before(timeout, oplock_break_timer_next)) {
 		oplock_break_timer_pending = true;
 		oplock_break_timer_next = timeout;
-		mod_delayed_work(system_wq, &oplock_break_timer_work,
+		mod_delayed_work(system_percpu_wq, &oplock_break_timer_work,
 				 time_after_eq(jiffies, timeout) ? 0 : timeout - jiffies);
 	}
 	mutex_unlock(&oplock_break_timer_lock);
Signature · 1 line
2.55.0
maintainer Applied
#1 lore raw
Quoted 5 lines · ZhangGuoDong

From: ZhangGuoDong <[email protected]>

Queueing the lease break timer on system_wq triggers the following warning:

Quoted 7 lines

workqueue: work func lease_break_timer [ksmbd] enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.

The oplock break timer and TCP transmit work also use deprecated system queues.

Applied it to #ksmbd-for-next.
Thanks!