Skip to content

Commit 31c8900

Browse files
Audra Mitchellhtejun
authored andcommitted
workqueue.c: Increase workqueue name length
Currently we limit the size of the workqueue name to 24 characters due to commit ecf6881 ("workqueue: make workqueue->name[] fixed len") Increase the size to 32 characters and print a warning in the event the requested name is larger than the limit of 32 characters. Signed-off-by: Audra Mitchell <audra@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 052d534 commit 31c8900

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

kernel/workqueue.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ enum {
108108
RESCUER_NICE_LEVEL = MIN_NICE,
109109
HIGHPRI_NICE_LEVEL = MIN_NICE,
110110

111-
WQ_NAME_LEN = 24,
111+
WQ_NAME_LEN = 32,
112112
};
113113

114114
/*
@@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
46664666
va_list args;
46674667
struct workqueue_struct *wq;
46684668
struct pool_workqueue *pwq;
4669+
int len;
46694670

46704671
/*
46714672
* Unbound && max_active == 1 used to imply ordered, which is no longer
@@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
46924693
}
46934694

46944695
va_start(args, max_active);
4695-
vsnprintf(wq->name, sizeof(wq->name), fmt, args);
4696+
len = vsnprintf(wq->name, sizeof(wq->name), fmt, args);
46964697
va_end(args);
46974698

4699+
if (len >= WQ_NAME_LEN)
4700+
pr_warn_once("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n", wq->name);
4701+
46984702
max_active = max_active ?: WQ_DFL_ACTIVE;
46994703
max_active = wq_clamp_max_active(max_active, flags, wq->name);
47004704

0 commit comments

Comments
 (0)